2016-08-30 2 views
0

Also lassen Sie uns von ganz oben starten.Python scheint keine Bibliotheken zu finden - Konflikt zwischen Benutzer und System Python-Versionen

Das ist das Problem, das ich zur Zeit mit bin:

[email protected]:~/cloud/simtk/opensim_core_install/lib/python2.7/site-packages$ python 
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import opensim 
Traceback (most recent call last): 
    File "<stdin>", line 1, in <module> 
    File "opensim/__init__.py", line 2, in <module> 
    from common import * 
    File "opensim/common.py", line 21, in <module> 
    _common = swig_import_helper() 
    File "opensim/common.py", line 20, in swig_import_helper 
    return importlib.import_module('_common') 
    File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module 
    __import__(name) 
ImportError: No module named _common 

Für interessieren die in dem Spezifika, Ich versuche, diesen package, zu verwenden und die bleeding edge Version speziell.

Von dem, was ich aus dem World Wide Web und anderen Quellen geruhen kann, ich habe zwei Versionen von Python auf meinem Rechner installiert

[email protected]:/usr$ which python && python --version 
/usr/bin/python 
Python 2.7.6 

und

[email protected]:/usr/local$ /usr/local/bin/python2.7 --version 
Python 2.7.9 

Wenn nun den Aufbau das oben Paket Man muss sich auf die libpython2.7.so Dateien beziehen, von denen ich zwei habe (und sie sind beide System, was bedeutet, dass sich keine in /usr/local/ befinden:

und ich gebaut, um die Umhüllungen von

Lauf
python setup.py install 

innen

~/cloud/simtk/opensim_core_install/lib/python2.7/site-packages 

das ist, wo er sich befindet. Jetzt, wenn es läuft, steckt es alles in das /usr/local/ Verzeichnis und nicht in das systemweit, und das ist, wo ich denke, Probleme erscheinen.

[email protected]:~/cloud/simtk/opensim_core_install/lib/python2.7/site-packages$ sudo python setup.py install 
[sudo] password for bob: 
running install 
running bdist_egg 
running egg_info 
writing opensim.egg-info/PKG-INFO 
writing top-level names to opensim.egg-info/top_level.txt 
writing dependency_links to opensim.egg-info/dependency_links.txt 
reading manifest file 'opensim.egg-info/SOURCES.txt' 
writing manifest file 'opensim.egg-info/SOURCES.txt' 
installing library code to build/bdist.linux-x86_64/egg 
running install_lib 
running build_py 
creating build/bdist.linux-x86_64/egg 
creating build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/_analyses.so -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/tools.py -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/simbody.py -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/actuators.py -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/_simbody.so -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/__init__.py -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/analyses.py -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/_simulation.so -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/version.py -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/_tools.so -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/_actuators.so -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/common.py -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/simulation.py -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/_common.so -> build/bdist.linux-x86_64/egg/opensim 
copying build/lib.linux-x86_64-2.7/opensim/__init__.pyc -> build/bdist.linux-x86_64/egg/opensim 
byte-compiling build/bdist.linux-x86_64/egg/opensim/tools.py to tools.pyc 
byte-compiling build/bdist.linux-x86_64/egg/opensim/simbody.py to simbody.pyc 
byte-compiling build/bdist.linux-x86_64/egg/opensim/actuators.py to actuators.pyc 
byte-compiling build/bdist.linux-x86_64/egg/opensim/analyses.py to analyses.pyc 
byte-compiling build/bdist.linux-x86_64/egg/opensim/version.py to version.pyc 
byte-compiling build/bdist.linux-x86_64/egg/opensim/common.py to common.pyc 
byte-compiling build/bdist.linux-x86_64/egg/opensim/simulation.py to simulation.pyc 
creating build/bdist.linux-x86_64/egg/EGG-INFO 
copying opensim.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO 
copying opensim.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO 
copying opensim.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO 
copying opensim.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO 
writing build/bdist.linux-x86_64/egg/EGG-INFO/native_libs.txt 
zip_safe flag not set; analyzing archive contents... 
opensim.actuators: module references __file__ 
opensim.tools: module references __file__ 
opensim.analyses: module references __file__ 
opensim.simbody: module references __file__ 
opensim.common: module references __file__ 
opensim.simulation: module references __file__ 
creating 'dist/opensim-4.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it 
removing 'build/bdist.linux-x86_64/egg' (and everything under it) 
Processing opensim-4.0-py2.7.egg 
removing '/usr/local/lib/python2.7/dist-packages/opensim-4.0-py2.7.egg' (and everything under it) 
creating /usr/local/lib/python2.7/dist-packages/opensim-4.0-py2.7.egg 
Extracting opensim-4.0-py2.7.egg to /usr/local/lib/python2.7/dist-packages 
opensim 4.0 is already the active version in easy-install.pth 

Installed /usr/local/lib/python2.7/dist-packages/opensim-4.0-py2.7.egg 
Processing dependencies for opensim==4.0 
Finished processing dependencies for opensim==4.0 

nun vermutlich, weil dies alles in /usr/local/ erstellt wird, wäre, warum die System-Version von Python nicht die dazugehörigen Bibliotheken finden kann? Problem ist, dass, wenn ich versuche, /usr/local/bin/python2.7 zu benutzen, es immer noch die Bibliotheken nicht finden kann.

Auch sollte ich hinzufügen:

[email protected]:~/cloud/simtk/opensim_core_install/lib/python2.7/site-packages$ ls * 
setup.py 

build: 
bdist.linux-x86_64 lib.linux-x86_64-2.7 

dist: 
opensim-4.0-py2.7.egg 

opensim: 
actuators.py _analyses.so _common.so simbody.py simulation.py tools.py 
_actuators.so common.py  __init__.py simbody.pyc _simulation.so _tools.so 
analyses.py common.pyc __init__.pyc _simbody.so tests   version.py 

opensim.egg-info: 
dependency_links.txt PKG-INFO SOURCES.txt top_level.txt 

und

[email protected]:~$ echo $LD_LIBRARY_PATH 
:/local/bob/cloud/simtk/opensim_core_install/lib/python2.7/site-packages/opensim 

Antwort

0

Von dem, was ich Ihre Frage erhalten Sie Gebäude versucht, indem man einfach python setup.py install läuft.

Sie müssen den Anweisungen in der Readme folgen und stattdessen mit der Ihrem Betriebssystem entsprechenden Methode erstellen.

+0

Es gibt keine Readme, gibt es das: https://github.com/simbody/simbody/tree/Simbody-3.5.3#linux-oder-mac-using-make und das: https: // github. com/opensim-org/opensim-core – Astrid

+0

Die readme ist der Text, den Sie unter dem Dateibrowser finden. – RainbowRevenge

+0

Ich habe buchstäblich keine Ahnung, worauf Sie sich beziehen; Das Installationsverzeichnis enthält keine Readme-Datei. Von welchem ​​Dateibrowser sprichst du und von welchem ​​Teil des Problems willst du sprechen? Weil alles funktioniert, werden die Python-Wrappings durcheinander gebracht. – Astrid

Verwandte Themen