turbulenz / turbulenz_engine

Turbulenz is a modular 3D and 2D game framework for making HTML5 powered games for browsers, desktops and mobile devices.
http://turbulenz.com
MIT License
4.57k stars 513 forks source link

Failed to create virtual env when running TurbulenzSDK-0.27.0.linux.run #28

Closed jcnauta closed 10 years ago

jcnauta commented 10 years ago

I would love to try the SDK out, but have problems installing it.

I downloaded TurbulenzSDK-0.27.0.linux.run from https://hub.turbulenz.com/#downloads and followed the Linux install instruction on docs.turbulenz.com/installing.html. Upon running the file, I get the error message listed below.

When I use sudo (even though there was no permission denied) everything is installed. I run source start_env. In the virtual environment, I try to run ./start_local.sh and get the following error:

(env)jelle@ubuntu:~/Turbulenz/SDK/0.27.0$ Error running local server
Traceback (most recent call last):
  File "/home/jelle/Turbulenz/SDK/0.27.0/env/bin/local_server", line 4, in <module>
    import pkg_resources
ImportError: No module named pkg_resources

With sudo it works and I can access localhost:8070, but then finally when I try to run dae2json from within the virtual environment, it gives the error:

Traceback (most recent call last):
  File "/home/jelle/Turbulenz/SDK/0.27.0/env/bin/dae2json", line 4, in <module>
    import pkg_resources
ImportError: No module named pkg_resources

This time sudo dae2json doesn't save me:

sudo: dae2json: command not found

All of this leads me to suspect that using sudo all this time was a mistake that bypassed the virtual environment, and even though the paths are set up correctly inside the environment, it doesn't have the pkg_resources module.

Help!

// FIRST ERROR MESSAGE
Unzipping the Turbulenz SDK ...
Creating a virtualenv in /home/jelle/Turbulenz/SDK/0.27.0 (this isolates the Turbulenz
tools from your system Python installation) ...
Running virtualenv with interpreter /usr/bin/python2.7
Creating env/lib/python2.7
Symlinking Python bootstrap modules
  Symlinking env/lib/python2.7/config
  Symlinking env/lib/python2.7/lib-dynload
  Symlinking env/lib/python2.7/os.py
  Ignoring built-in bootstrap module: posix
  Symlinking env/lib/python2.7/posixpath.py
  Cannot import bootstrap module: nt
  Symlinking env/lib/python2.7/ntpath.py
  Symlinking env/lib/python2.7/genericpath.py
  Symlinking env/lib/python2.7/fnmatch.py
  Symlinking env/lib/python2.7/locale.py
  Symlinking env/lib/python2.7/encodings
  Symlinking env/lib/python2.7/codecs.py
  Symlinking env/lib/python2.7/stat.py
  Symlinking env/lib/python2.7/UserDict.py
  Symlinking env/lib/python2.7/copy_reg.py
  Symlinking env/lib/python2.7/types.py
  Symlinking env/lib/python2.7/re.py
  Symlinking env/lib/python2.7/sre.py
  Symlinking env/lib/python2.7/sre_parse.py
  Symlinking env/lib/python2.7/sre_constants.py
  Symlinking env/lib/python2.7/sre_compile.py
  Ignoring built-in bootstrap module: zlib
  Symlinking env/lib/python2.7/warnings.py
  Symlinking env/lib/python2.7/linecache.py
  Symlinking env/lib/python2.7/_abcoll.py
  Symlinking env/lib/python2.7/abc.py
  Symlinking env/lib/python2.7/_weakrefset.py
Creating env/lib/python2.7/site-packages
Writing env/lib/python2.7/site.py
Writing env/lib/python2.7/orig-prefix.txt
Writing env/lib/python2.7/no-global-site-packages.txt
Creating parent directories for env/include
Symlinking env/include/python2.7
Creating env/bin
New python executable in env/bin/python2.7
Changed mode of env/bin/python2.7 to 0775
Also creating executable in env/bin/python
Changed mode of env/bin/python to 0775
Testing executable with env/bin/python2.7 -c "import sys;out=sys.stdout;getattr(out, "buffer", out).write(sys.prefix.encode("utf-8"))"
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 562, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 544, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 271, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 246, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 236, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 577, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 476, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 355, in _init_posix
    raise IOError(msg)
IOError: invalid Python installation: unable to open /home/jelle/Turbulenz/SDK/0.27.0/env/local/include/python2.7/pyconfig.h (No such file or directory)
ERROR: The executable env/bin/python2.7 is not functioning
ERROR: It thinks sys.prefix is u'/home/jelle/Turbulenz/SDK/0.27.0' (should be u'/home/jelle/Turbulenz/SDK/0.27.0/env')
ERROR: virtualenv is not compatible with this system or executable
ERROR: Failed to create virtual env
ianballantyne commented 10 years ago

It seems that you are hitting a similar issue to this: http://stackoverflow.com/questions/5345934/problem-running-python-from-crontab-invalid-python-installation or this http://noelusion.com/2013/Fixing-the-mysterious-virtualenv-error-IOError-invalid-Python-installation/

What version of virtualenv do you have? Try: virtualenv --version

We recommend 1.9.1 or higher.

Once you've upgraded, try again. Make sure to remove the ~/Turbulenz/SDK/0.27.0 directory and start from scratch

jcnauta commented 10 years ago

I have virtualenv 1.10.1, but thanks for the suggestion. I'll have a look at the two links you posted, hadn't found them yet.