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

VizDoom and virtualenv #80

Closed
glebreutov opened this issue Jun 5, 2016 · 4 comments
Closed

VizDoom and virtualenv #80

glebreutov opened this issue Jun 5, 2016 · 4 comments

Comments

@glebreutov
Copy link

glebreutov commented Jun 5, 2016

I trying to run basic.py with python inside of virtualenv, and getting this errors:
Traceback (most recent call last): File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 550, in <module> main() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 532, in main known_paths = addusersitepackages(known_paths) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 266, in addusersitepackages user_site = getusersitepackages() File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 241, in getusersitepackages user_base = getuserbase() # this will also set USER_BASE File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py", line 231, in getuserbase USER_BASE = get_config_var('userbase') File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 520, in get_config_var return get_config_vars().get(name) File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py", line 453, in get_config_vars import re File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py", line 108, in <module> import _locale SystemError: dynamic module not initialized properly

I ran cmake and make under my virtualenv, before start. When I run it under default python - everything works well.

My OS is OS X, list of pip packages:

(venv) $ pip list dask (0.9.0) decorator (4.0.9) networkx (1.11) numpy (1.11.0) Pillow (3.2.0) pip (8.1.2) scikit-image (0.12.3) scipy (0.17.1) setuptools (22.0.5) six (1.10.0) toolz (0.8.0) wheel (0.29.0)

Any suggestions?

@wjaskowski
Copy link
Collaborator

try python basic.py (basic.py has #!/usr/bin/python) on the top.

Wojciech Jaśkowski, Ph.D.
Laboratory of Intelligent Decision Support Systems
Institute of Computing Science
Poznan University of Technology, Poland
http://www.cs.put.poznan.pl/wjaskowski

On 5 June 2016 at 22:02, glebreutov notifications@github.com wrote:

I trying to run basic.py with python inside of virtualenv, and getting
this errors:
Traceback (most recent call last):
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
line 550, in
main()
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
line 532, in main
known_paths = addusersitepackages(known_paths)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
line 266, in addusersitepackages
user_site = getusersitepackages()
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
line 241, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site.py",
line 231, in getuserbase
USER_BASE = get_config_var('userbase')
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py",
line 520, in get_config_var
return get_config_vars().get(name)
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sysconfig.py",
line 453, in get_config_vars
import re
File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/re.py",
line 108, in
import _locale
SystemError: dynamic module not initialized properly

I ran cmake and make under my virtualenv, before start. When I run it
under default python - everything works well.

My OS is OS X, list of pip packages:

(venv) BADASSGLEB:site-packages glebreutov$ pip list
dask (0.9.0)
decorator (4.0.9)
networkx (1.11)
numpy (1.11.0)
Pillow (3.2.0)
pip (8.1.2)
scikit-image (0.12.3)
scipy (0.17.1)
setuptools (22.0.5)
six (1.10.0)
toolz (0.8.0)
wheel (0.29.0)

Any suggestions?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#80, or mute the thread
https://github.com/notifications/unsubscribe/AEuSHfSG_o6FpzgmwW9oa4MS85QTA9nTks5qIytGgaJpZM4IubqY
.

@glebreutov
Copy link
Author

In my original issue I ran basic.py via PyCharm.

When I trying to run through terminal (as you mentioned) - I'm getting another error (same with or without #!/usr/bin/python on top):

(venv)$:~/Py/ViZDoom/examples/python$ python basic.py
ImportError: numpy.core.multiarray failed to import
ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
File "basic.py", line 25, in
game = DoomGame()
TypeError: init() should return None, not 'NoneType'

Seems, here we have some conflict of numpy versions. What version of numpy is used in VizDoom

PS All mentioned is related to python inside virtualenv

@wjaskowski
Copy link
Collaborator

On 6 June 2016 at 20:16, glebreutov notifications@github.com wrote:

Seems, here we have some conflict of numpy versions. What version of numpy
is used in VizDoom

The one you have on your system. So maybe the problem is you have two
different versions of numpy (a global one and the one in virtualenv). It
might be that compiling ViZDoom inside virtualenv could solve the problem
but I am not sure which python it will take.

It should work at least in virtualenv because it does on my machine. I have
numpy 1.11.0 in both environments.

@glebreutov
Copy link
Author

Seems I found a solution: the problem was in brew installed python (similar issues #45 and #46 ). I managed to run using building instructions for OS X.
Thanks for a help!

Btw, here the script that I use to build VizDoom, maybe it can be helpful for somebody:

brew install boost --with-python
brew install boost-python
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON=ON \
-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/include/python2.7/ \
-DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
make
rm bin/vizdoom
ln -s vizdoom.app/Contents/MacOS/vizdoom bin/vizdoom
cd examples/python
python basic.py

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

3 participants