Python scripting issues - compile from source (linux)
Posted: Thu Jun 12, 2014 2:05 am
Hi there,
I just tried to compile OpenSim 3.2 with python scripting enabled.
Debian GCC 4.7.2
Python 2.7.3
SWIG 2.0.7
python-setuptools 0.6.24
Everything works fine, but when I try to import opensim I get an import error:
---------------------------------------------------------------------
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/opensim-3.2-py2.7.egg/opensim/__init__.py", line 1, in <module>
from opensim import *
File "/usr/local/lib/python2.7/dist-packages/opensim-3.2-py2.7.egg/opensim/opensim.py", line 26, in <module>
_opensim = swig_import_helper()
File "/usr/local/lib/python2.7/dist-packages/opensim-3.2-py2.7.egg/opensim/opensim.py", line 22, in swig_import_helper
_mod = imp.load_module('_opensim', fp, pathname, description)
ImportError: dynamic module does not define init function (init_opensim)
---------------------------------------------------------------------
I tried to solve this by brute force and just decided to try with python3:
Python 3.2.3mu
python3-setuptools 0.6.24
Now the import works fine, I can do "import opensim as osim" but as soon as try to load a model i get:
---------------------------------------------------------------------
>>> m = osim.Model()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Model'
>>>
---------------------------------------------------------------------
Could anyone please tell me what I am doing wrong?
Thank You
I just tried to compile OpenSim 3.2 with python scripting enabled.
Debian GCC 4.7.2
Python 2.7.3
SWIG 2.0.7
python-setuptools 0.6.24
Everything works fine, but when I try to import opensim I get an import error:
---------------------------------------------------------------------
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/opensim-3.2-py2.7.egg/opensim/__init__.py", line 1, in <module>
from opensim import *
File "/usr/local/lib/python2.7/dist-packages/opensim-3.2-py2.7.egg/opensim/opensim.py", line 26, in <module>
_opensim = swig_import_helper()
File "/usr/local/lib/python2.7/dist-packages/opensim-3.2-py2.7.egg/opensim/opensim.py", line 22, in swig_import_helper
_mod = imp.load_module('_opensim', fp, pathname, description)
ImportError: dynamic module does not define init function (init_opensim)
---------------------------------------------------------------------
I tried to solve this by brute force and just decided to try with python3:
Python 3.2.3mu
python3-setuptools 0.6.24
Now the import works fine, I can do "import opensim as osim" but as soon as try to load a model i get:
---------------------------------------------------------------------
>>> m = osim.Model()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'Model'
>>>
---------------------------------------------------------------------
Could anyone please tell me what I am doing wrong?
Thank You