pydart2 icon indicating copy to clipboard operation
pydart2 copied to clipboard

cannot import name 'pydart2_api'

Open steelexu opened this issue 7 years ago • 11 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'

steelexu avatar Jul 15 '17 08:07 steelexu

+1

tartavull avatar Sep 01 '17 22:09 tartavull

@steelexu Try cloning the repo directy and running python3 setup.py build

tartavull avatar Sep 01 '17 22:09 tartavull

python3 setup.py build works for me.

arpit15 avatar Sep 28 '17 18:09 arpit15

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

umsukgod avatar Nov 07 '17 12:11 umsukgod

I think you have to run setup.py build using python2 if you want python2 and python3 if you want python3

kniranjankumar avatar Dec 05 '17 23:12 kniranjankumar

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

aakashnandi198 avatar Jan 09 '19 18:01 aakashnandi198

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.

vyi avatar Apr 11 '19 08:04 vyi

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'

faceromarchesotti avatar Apr 12 '19 23:04 faceromarchesotti

Are you installing the right version of dartsim?

kniranjankumar avatar Apr 13 '19 06:04 kniranjankumar

@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.

juanmed avatar Jun 05 '19 03:06 juanmed

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.

ashley-holton avatar Nov 08 '21 22:11 ashley-holton