Python error no attribute '__reduce_cython__'

Install support for openEMS

Moderators: thorsten, sebastian

Post Reply
montanaviking
Posts: 90
Joined: Mon 30 Sep 2013, 22:27

Python error no attribute '__reduce_cython__'

Post by montanaviking » Tue 22 Oct 2019, 23:31

I have recently installed openEMS version 0.35 and verified it working with matlab input files.
My system is Ubuntu 18.04 64bit
I was attempting to get openEMS to run from the Python interface and I did the setup for Python. I have Python ver 3.6
My commands were:
$ python3
>>> import os, tempfile
>>> from pylab import *
>>> from CSXCAD import ContinuousStructure
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "CSXCAD/CSXCAD.pyx", line 53, in init CSXCAD.CSXCAD
AttributeError: type object 'CSXCAD.CSXCAD.ContinuousStructure' has no attribute '__reduce_cython__'
>>> from openEMS import openEMS
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "ParameterObjects.pxd", line 27, in init openEMS.openEMS
cdef class ParameterSet:
File "CSXCAD/CSXCAD.pyx", line 53, in init CSXCAD.CSXCAD
AttributeError: type object 'CSXCAD.CSXCAD.ContinuousStructure' has no attribute '__reduce_cython__'
#########################

I am running cython version 0.29.13 and have updated all other Python packages via pip3 to their latest versions.
Could anyone kindly give me a clue as to how to fix this?
Thanks,
Phil

thorsten
Posts: 1389
Joined: Mon 27 Jun 2011, 12:26

Re: Python error no attribute '__reduce_cython__'

Post by thorsten » Wed 23 Oct 2019, 08:02

Please try the latest git version, not the released v0.0.35.
It is a bit outdated unfortunately...

thorsten
Posts: 1389
Joined: Mon 27 Jun 2011, 12:26

Re: Python error no attribute '__reduce_cython__'

Post by thorsten » Wed 23 Oct 2019, 08:17

I tried and everything works fine for me. But I'm not running Ubuntu...
Hopefully it works for you with the latest git master.

montanaviking
Posts: 90
Joined: Mon 30 Sep 2013, 22:27

Re: Python error no attribute '__reduce_cython__'

Post by montanaviking » Wed 23 Oct 2019, 18:43

Hi Thorsten,
I'm very thankful you're still supporting openEMS after all these years! Thanks again for these tools.
I'm a bit of an novice with github but I went to https://github.com/thliebig/openEMS and clicked on the green clone or download button and got the zip file.
It looks like the latest revisions date from Sept 7, 2019 so this does appear fresh.
I did have a couple questions though, namely:
1. Does the openEMS-master.zip contain all the software I need for openEMS and what are the best instructions for the install to Linux? You have instructions at http://openems.de/index.php/Compile_from_Source.html
but I'm thinking you have new instructions for the latest source building methods?
2. What do I need to do to install the Python interface? I did install that from git from site:
https://github.com/thliebig/openEMS/tree/master/python
Is this correct?
3. While I would like the latest version of openEMS, should I bother with the Python interface or is the matlab/octave interface still better-developed and more proven? I have no compelling reason to use the Python interface, but since I'm more familiar with Python, it would be slightly easier. I did, however, make extensive use of the Octave interface a few years ago, so that would still be fine with me.
Thanks again,
Phil

thorsten
Posts: 1389
Joined: Mon 27 Jun 2011, 12:26

Re: Python error no attribute '__reduce_cython__'

Post by thorsten » Wed 23 Oct 2019, 18:52

Hi Phil,

in this case I would recommend to use the Octave interface. The python interface is still very experimental and incomplete. Unfortunately I have little time to really polish it.

In case you want to install from source. Use the instructions from github:
https://github.com/thliebig/openEMS-Pro ... nstruction

I hope they are still reasonable up to date for Ubuntu 18.04. I'm not using Ubuntu any more...

regards
Thorsten

montanaviking
Posts: 90
Joined: Mon 30 Sep 2013, 22:27

Re: Python error no attribute '__reduce_cython__'

Post by montanaviking » Thu 24 Oct 2019, 05:42

Hi Thorsten,
Thanks, I think I had followed the install procedure you gave here in your last post to me. I'll keep just using Octave and see no real compulsion to go to Python yet. I plan to use this on 3-D simulations to compare to Keysight ADS 2-D simulations on our upcoming carbon nanotube amplifier project.
Running an example file, i.e. "Simple_Patch_Antenna.m" yields the version information:
openEMS 64bit -- version v0.0.35-45-gde23172
| (C) 2010-2018 Thorsten Liebig <thorsten.liebig@gmx.de> GPL license
----------------------------------------------------------------------
Used external libraries:
CSXCAD -- Version: v0.6.2-85-g55899d0
hdf5 -- Version: 1.10.0
compiled against: HDF5 library version: 1.10.0-patch1
tinyxml -- compiled against: 2.6.2
fparser
boost -- compiled against: 1_65_1
vtk -- Version: 6.3.0
compiled against: 6.3.0

I think this is up to date?
Thanks,
Phil

Post Reply