Page 1 of 1

Problem with pyeviews

Posted: Fri May 21, 2021 10:29 am
by francisco
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.

Re: Problem with pyeviews

Posted: Mon May 24, 2021 7:59 am
by EViews Steve
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.

Re: Problem with pyeviews

Posted: Wed May 26, 2021 5:39 pm
by EViews Rebecca
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.

Re: Problem with pyeviews

Posted: Thu May 27, 2021 10:01 am
by francisco
Ok, thank you.