Problem with pyeviews

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

francisco
Posts: 27
Joined: Fri Jan 15, 2010 3:50 pm

Problem with pyeviews

Postby francisco » Fri May 21, 2021 10:29 am

Hi.
I have already updated to the latest version of python and pyeviews in Anaconda. I am using the standard version of Eviews12.
To create series in Python and take them to Eviews I use the following code (found in WHITEPAPER AS OF 7/22/2016 "pyeviews: Python + Eviews"

import numpy as np
import pandas as pa
dtsa = pa.date_range ('1998', periods = 3, freq = 'A')
benchmark = pa.Series ([4000., 4161.4, np.nan], index = dtsa, name = 'benchmark')
import pyeviews as evp
eviewsapp = evp.GetEViewsApp (instance = 'new', showwindow = True)
evp.PutPythonAsWF (benchmark, app = eviewsapp)

However, in the eviews workfile the benchmark series is created but the values are not being copied and they are blank in eviews workfile. Could you tell me what is the problem?

Thanks.

EViews Steve
EViews Developer
Posts: 788
Joined: Tue Sep 16, 2008 3:00 pm
Location: Irvine, CA

Re: Problem with pyeviews

Postby EViews Steve » Mon May 24, 2021 7:59 am

Thanks for the bug report. We've been able to confirm the issue and it seems to be a problem with the comtypes library that we depend on to make the call to our COM Application object. It seems that comtypes is not converting a Python list object into a proper COM Variant type when running on Python 3.8 or above.

I've reported this issue with the comtypes developers. I'll post again if we figure out any workaround to this issue. If you'd like to follow the pyeviews examples in a working environment, please use Python 3.6 or 3.7 for now.

EViews Rebecca
EViews Developer
Posts: 113
Joined: Thu Apr 18, 2013 8:37 am

Re: Problem with pyeviews

Postby EViews Rebecca » Wed May 26, 2021 5:39 pm

We've fixed this problem by changing pyeviews to use a different package for COM objects. Please update to pyeviews 1.0.3 using "pip install --upgrade pyeviews" if you're in a regular Python environment, or "conda update -c bexer pyeviews" if you're in a Conda environment.

francisco
Posts: 27
Joined: Fri Jan 15, 2010 3:50 pm

Re: Problem with pyeviews

Postby francisco » Thu May 27, 2021 10:01 am

Ok, thank you.


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 28 guests