Python cannot seem to find libraries - conflict between user and system python versions
<p>So lets start from the very very top. </p>

<p>This is the problem I am currently having:</p>

<pre><code>bob@me:~/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.
&gt;&gt;&gt; import opensim
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "opensim/__init__.py", line 2, in &lt;module&gt;
    from common import *
  File "opensim/common.py", line 21, in &lt;module&gt;
    _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
</code></pre>

<p>For those interested in the specifics, I am trying to use this <a href="https://github.com/opensim-org/opensim-core" rel="nofollow">package</a>, and specifically the bleeding edge version.</p>

<p>From what I can deign from the world wide web and other sources, I have two versions of python installed on my machine</p>

<pre><code>bob@me:/usr$ which python &amp;&amp; python --version
/usr/bin/python
Python 2.7.6
</code></pre>

<p>and</p>

<pre><code>bob@me:/usr/local$ /usr/local/bin/python2.7 --version
Python 2.7.9
</code></pre>

<p>Now, when building the above package one has to make reference to the <code>libpython2.7.so</code> files of which I have two (and they are both system, which is to say that none are located in <code>/usr/local/</code>:</p>

<pre><code>bob@me:/usr$ find . -name 'libpython2.7.so'
./lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so
./lib/x86_64-linux-gnu/libpython2.7.so
</code></pre>

<p>and I built the wrappings by running </p>

<pre><code>python setup.py install
</code></pre>

<p>inside </p>

<pre><code>~/cloud/simtk/opensim_core_install/lib/python2.7/site-packages
</code></pre>

<p>which is where it resides. Now when it runs it puts it all in the <code>/usr/local/</code> dir rather than the system wide one, and this is where I think problems appear.</p>

<pre><code>bob@me:~/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 -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/tools.py -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/simbody.py -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/actuators.py -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/_simbody.so -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/__init__.py -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/analyses.py -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/_simulation.so -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/version.py -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/_tools.so -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/_actuators.so -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/common.py -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/simulation.py -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/_common.so -&gt; build/bdist.linux-x86_64/egg/opensim
copying build/lib.linux-x86_64-2.7/opensim/__init__.pyc -&gt; 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 -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
copying opensim.egg-info/SOURCES.txt -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
copying opensim.egg-info/dependency_links.txt -&gt; build/bdist.linux-x86_64/egg/EGG-INFO
copying opensim.egg-info/top_level.txt -&gt; 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
</code></pre>

<p>Now presumably because this is all created in <code>/usr/local/</code> that would be why the system version of python cannot find the associated libraries? Problem is that when I try to use <code>/usr/local/bin/python2.7</code> it still cannot find the libraries.</p>

<p>Also I should add:</p>

<pre><code>bob@me:~/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
</code></pre>

<p>and</p>

<pre><code>bob@me:~$ echo $LD_LIBRARY_PATH 
:/local/bob/cloud/simtk/opensim_core_install/lib/python2.7/site-packages/opensim
</code></pre>

<p>From what I get by your question you tried building by simply running <code>python setup.py install</code>.</p>

<p>You have to follow the instructions in the Readme and build with the method corresponding to your operating system instead.</p>

python