Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python Fail to Import _DeepMimicCore #12

Closed
Phazed98 opened this issue Oct 19, 2018 · 12 comments
Closed

Python Fail to Import _DeepMimicCore #12

Phazed98 opened this issue Oct 19, 2018 · 12 comments

Comments

@Phazed98
Copy link

Microsoft Windows [Version 10.0.17134.345]
(c) 2018 Microsoft Corporation. All rights reserved.

X:\DeepMimic\DeepMimic>python mpi_run.py
Running with 1 workers
cmd: mpiexec -n 1 python DeepMimic_Optimizer.py
Traceback (most recent call last):
File "X:\DeepMimic\DeepMimic\DeepMimicCore\DeepMimicCore.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "C:\Program Files\Python36\lib\importlib_init_.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 658, in _load_unlocked
File "", line 571, in module_from_spec
File "", line 922, in create_module
File "", line 219, in _call_with_frames_removed
ImportError: DLL load failed: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "DeepMimic_Optimizer.py", line 3, in
from env.deepmimic_env import DeepMimicEnv
File "X:\DeepMimic\DeepMimic\env\deepmimic_env.py", line 3, in
from DeepMimicCore import DeepMimicCore
File "X:\DeepMimic\DeepMimic\DeepMimicCore\DeepMimicCore.py", line 17, in
_DeepMimicCore = swig_import_helper()
File "X:\DeepMimic\DeepMimic\DeepMimicCore\DeepMimicCore.py", line 16, in swig_import_helper
return importlib.import_module('DeepMimicCore')
File "C:\Program Files\Python36\lib\importlib_init
.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_DeepMimicCore'

I get this error attempting to run mpi_run.py or any of the other python scripts.

I successfully built the wrapper as far as I know (No Build Errors) I unfortunately don't know swig or python well enough to sort this out myself and was looking for some guidance.

@xbpeng
Copy link
Owner

xbpeng commented Oct 19, 2018

I usually see this issue if some of the c++ libraries are not installed. Check that you have the OpenGL, glew, and glut dll where they should be.

@Phazed98
Copy link
Author

Thanks, sorted it out. glut dll was out of place.

@nghorbani
Copy link

Thanks for sharing your code and being helpful with issues. I have a similar problem in my Ubuntu machine and cannot figure out the cause of the issue. So I wanted to ask where is the correct location for the libraries you mentioned, eg. OpenGL, glew, and glut dll, in Linux?

I am running Ubuntu 18.04 and have the following versions installed with their proper methods:

  • OpenGL: command "glxinfo | grep "OpenGL version" "-> shows me: OpenGL version string: 4.6.0 NVIDIA 410.79
  • glew: installed with make install under root user. confirmed shared objects at /usr/lib64/libGLEW.so.2.1 and /usr/lib/libGLEW.so.2.1
  • glut: Freeglut 3.0.0 and installed with make install. moreover tried installing with apt install freeglut3-dev package.

After all these I still get the following error even after a successful build of the wrapper:

python3 DeepMimic.py --arg_file args/kin_char_args.txt
Traceback (most recent call last):
File "/me/DeepMimic/DeepMimicCore/DeepMimicCore.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 994, in _gcd_import
File "", line 971, in _find_and_load
File "", line 955, in _find_and_load_unlocked
File "", line 658, in _load_unlocked
File "", line 571, in module_from_spec
File "", line 922, in create_module
File "", line 219, in _call_with_frames_removed
ImportError: libGLEW.so.2.1: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "DeepMimic.py", line 9, in
from env.deepmimic_env import DeepMimicEnv
File "/me/DeepMimic/env/deepmimic_env.py", line 3, in
from DeepMimicCore import DeepMimicCore
File "/me/DeepMimic/DeepMimicCore/DeepMimicCore.py", line 17, in
_DeepMimicCore = swig_import_helper()
File "/me/DeepMimic/DeepMimicCore/DeepMimicCore.py", line 16, in swig_import_helper
return importlib.import_module('_DeepMimicCore')
File "/usr/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_DeepMimicCore'

@bsivanantham
Copy link

bsivanantham commented Dec 24, 2018

I am having same issue ..

Traceback (most recent call last):
  File "/home/balavivek/PycharmProjects/DeepMimic/DeepMimicCore/DeepMimicCore.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/home/balavivek/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 658, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 571, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 922, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /home/balavivek/PycharmProjects/DeepMimic/DeepMimicCore/_DeepMimicCore.so: undefined symbol: _ZN11btMultiBody19setJointPosMultiDofEiPKf

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "DeepMimic.py", line 9, in <module>
    from env.deepmimic_env import DeepMimicEnv
  File "/home/balavivek/PycharmProjects/DeepMimic/env/deepmimic_env.py", line 3, in <module>
    from DeepMimicCore import DeepMimicCore
  File "/home/balavivek/PycharmProjects/DeepMimic/DeepMimicCore/DeepMimicCore.py", line 17, in <module>
    _DeepMimicCore = swig_import_helper()
  File "/home/balavivek/PycharmProjects/DeepMimic/DeepMimicCore/DeepMimicCore.py", line 16, in swig_import_helper
    return importlib.import_module('_DeepMimicCore')
  File "/home/balavivek/anaconda3/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named `'_DeepMimicCore'` 
```

@sloganking
Copy link
Contributor

@Phazed98 would it be possible for you to write where you found your glut dll and where you ended up putting it?

@IntelligentIndia7
Copy link
Contributor

I am running the same on Linux and I got the following error. Any help would be great!!!

Traceback (most recent call last):
File "/home/teai/Downloads/DeepMimic/DeepMimic-master/DeepMimicCore/DeepMimicCore.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: libGLEW.so.2.1: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "DeepMimic.py", line 9, in
from env.deepmimic_env import DeepMimicEnv
File "/home/teai/Downloads/DeepMimic/DeepMimic-master/env/deepmimic_env.py", line 3, in
from DeepMimicCore import DeepMimicCore
File "/home/teai/Downloads/DeepMimic/DeepMimic-master/DeepMimicCore/DeepMimicCore.py", line 17, in
_DeepMimicCore = swig_import_helper()
File "/home/teai/Downloads/DeepMimic/DeepMimic-master/DeepMimicCore/DeepMimicCore.py", line 16, in swig_import_helper
return importlib.import_module('_DeepMimicCore')
File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_DeepMimicCore'

@bsivanantham
Copy link

@IntelligentIndia7 I had the same issue first check you Glew installation.
second check your bullet installation. and Check if /usr/include or /usr/local/include has bullet file.
If the file is not available manually run gcc -I and missing files names like -lGLEW -lGL -lGLU -lglut -lBulletDynamics -lBulletCollision -lLinearMath -lm -lstdc++ to /usr/include

for me running gcc solved the issue.

@IntelligentIndia7
Copy link
Contributor

I had solved the above error by adding the path of libGLEW.so.2.1 to LD_LIBRARY_PATH. Now I am getting the following error. Any help regarding the same? Thanks in advance!!!!

Traceback (most recent call last):
File "/home/teai/Downloads/DeepMimic/DeepMimic-master/DeepMimicCore/DeepMimicCore.py", line 14, in swig_import_helper
return importlib.import_module(mname)
File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 666, in _load_unlocked
File "", line 577, in module_from_spec
File "", line 906, in create_module
File "", line 222, in _call_with_frames_removed
ImportError: /home/teai/Downloads/DeepMimic/DeepMimic-master/DeepMimicCore/_DeepMimicCore.so: undefined symbol: _ZN11btMultiBody22addJointTorqueMultiDofEiPKf

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "DeepMimic.py", line 9, in
from env.deepmimic_env import DeepMimicEnv
File "/home/teai/Downloads/DeepMimic/DeepMimic-master/env/deepmimic_env.py", line 3, in
from DeepMimicCore import DeepMimicCore
File "/home/teai/Downloads/DeepMimic/DeepMimic-master/DeepMimicCore/DeepMimicCore.py", line 17, in
_DeepMimicCore = swig_import_helper()
File "/home/teai/Downloads/DeepMimic/DeepMimic-master/DeepMimicCore/DeepMimicCore.py", line 16, in swig_import_helper
return importlib.import_module('_DeepMimicCore')
File "/usr/lib/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_DeepMimicCore'

@IntelligentIndia7
Copy link
Contributor

Can some one help me with Bullet installation, I guess the problem is with Bullet.

I just ran build_cmake_pybullet_double.sh with double precision flag set off. Is that the right way or should I follow other method mentioned in Read me of Bullet with premake

@bsivanantham
Copy link

bsivanantham commented Mar 7, 2019 via email

@IntelligentIndia7
Copy link
Contributor

I have solved the error by Installing Bullet 2.88 instead of 2.87 and also ran command 'sudo make install' after ./build_cmake_pybullet_double.sh to overcome the linker errors to BulletDynamics and BulletCollision. Thanks for the help @bsivanantham

@spodila1
Copy link

spodila1 commented Jan 9, 2020

Hello I am getting the errors as some of you mention before. I did ran command 'sudo make install' after ./build_cmake_pybullet_double.sh but the problem is not be solved. Could anyone please help me on this.

Traceback (most recent call last):
File "DeepMimic.py", line 9, in
from env.deepmimic_env import DeepMimicEnv
File "/home/sah.pod/work/Deep-Mimic/DeepMimic-master/env/deepmimic_env.py", line 3, in
from DeepMimicCore import DeepMimicCore
File "/home/sah.pod/work/Deep-Mimic/DeepMimic-master/DeepMimicCore/DeepMimicCore.py", line 13, in
from . import _DeepMimicCore
ImportError: /home/sah.pod/work/Deep-Mimic/DeepMimic-master/DeepMimicCore/_DeepMimicCore.so: undefined symbol: _ZN11btMultiBody22addJointTorqueMultiDofEiPKf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants