1

I'm having some problems understanding the importing of a python package with extensions that was installed with setup.py. The packages is 'gmes', and it has 4 extension modules which are .so files.

  1. The first attempt to load the package gmes gives an error about a symbol c0
  2. loading the extension module _constant.so which contains that symbol, followed by reloading the 'gmes' package, clears that symbol error and introduces a new error about a second extension module '_pw_material.so'.
  3. loading that 2nd extension module explicitly has no effect on the message that it is missing upon 3rd attempt to load 'gmes'.

I get slightly different results depending on which directory I start python from. It seems like I'm missing something simple about conventions with pythons packages and extensions.

There's another question suggesting to use LD_LIBRARY_PATH and ldconfig. I've only tried LD_LIBRARY_PATH and it hasn't worked.

Any thoughts appreciated!

jb@dellxps13:~/Downloads/gmes-0.9.5/gmes$ python
Python 2.7.9 (default, Apr  2 2015, 15:33:21) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> import gmes
No module named psyco. Execution speed might be slow.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/gmes/__init__.py", line 51, in <module>
    from fdtd import *
  File "/usr/local/lib/python2.7/dist-packages/gmes/fdtd.py", line 24, in <module>
    from geometry import GeomBoxTree, in_range, DefaultMedium
  File "/usr/local/lib/python2.7/dist-packages/gmes/geometry.py", line 22, in <module>
    from pygeom import *
  File "/src/pygeom.pyx", line 9, in init gmes.pygeom (src/pygeom.c:29837)
  File "/src/material.pyx", line 23, in init gmes.material (src/material.c:48954)
ImportError: cannot import name c0
>>> import _constant
>>> import gmes
No module named psyco. Execution speed might be slow.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/gmes/__init__.py", line 51, in <module>
    from fdtd import *
  File "/usr/local/lib/python2.7/dist-packages/gmes/fdtd.py", line 25, in <module>
    from file_io import Probe
  File "/usr/local/lib/python2.7/dist-packages/gmes/file_io.py", line 23, in <module>
    from pw_material import MaterialElectricReal, MaterialElectricCmplx
ImportError: No module named pw_material
>>> import _pw_material
>>> import gmes
No module named psyco. Execution speed might be slow.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/gmes/__init__.py", line 51, in <module>
    from fdtd import *
  File "/usr/local/lib/python2.7/dist-packages/gmes/fdtd.py", line 25, in <module>
    from file_io import Probe
  File "/usr/local/lib/python2.7/dist-packages/gmes/file_io.py", line 23, in <module>
    from pw_material import MaterialElectricReal, MaterialElectricCmplx
ImportError: No module named pw_material
>>> 

0 Answers0