cannot import name 'pydart2_api'
steelexu opened this issue · comments
I'm using a virturalenv of pytthon3, and swig has been installed
import pydart2
Traceback (most recent call last):
File "", line 1, in
File "/home/steele/topics/py3nb/lib/python3.4/site-packages/pydart2/init.py", line 5, in
from . import pydart2_api as papi
ImportError: cannot import name 'pydart2_api'
+1
@steelexu
Try cloning the repo directy and running python3 setup.py build
python3 setup.py build
works for me.
I'm using ubuntu 16.04 . I have similar problem.
Since I run python3 setup.py build
, python3 works well.
However in the case of python2, following problem keeps remaining.
import pydart2
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/pydart2/init.py", line 5, in
from . import pydart2_api as papi
ImportError: cannot import name pydart2_api
I think you have to run setup.py build using python2 if you want python2 and python3 if you want python3
I am using pydart2 on python2.7 and what worked for me was to copy the contents in pydart2/pydart2/. to miniconda/env/aakash/lib/python2.7/site-packages/pydart2
import pydart2 as pydart
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/dist-packages/pydart2/__init__.py", line 5, in <module>
from . import pydart2_api as papi
ImportError: cannot import name 'pydart2_api'
I tried building from source and installing with pip3
Neither works.
Hello, I have tried both installing with pip and building from source but I get the same error as @vyi
< import pydart2 as pydart
File "/usr/local/lib/python3.5/dist-packages/pydart2/init.py", line 5, in
from . import pydart2_api as papi
ImportError: cannot import name 'pydart2_api'
Are you installing the right version of dartsim?
@Ninjninja do you know what is the last version of dartsim compatible with pydart2? I am having the same issue and reverted to dartsim 6.8.2 without success when building pydart2 from source and trying to import it. Please see here.
I am using pydart2 on python2.7 and what worked for me was to copy the contents in pydart2/pydart2/. to miniconda/env/aakash/lib/python2.7/site-packages/pydart2
This worked for me on python3 as well. I copied it into /home/[username]/anaconda3/envs/[env name]/lib/python3.7/site-packages/pydart2 instead.