title: Python Import Different Libraries from Different Versions
body: <p>I'm trying to develop a Python script, and I seem to be running into a conflict between two of the libraries that I want to include.</p>
  
  <p>The first dependency that I have is pymoos (<a href="https://github.com/msis/python-moos" rel="nofollow noreferrer">https://github.com/msis/python-moos</a>), which is necessary to connect to my communication architecture. I've built the code and manually installed the resultant pymoos.so in the following places:</p>
  
  <ul>
  <li>/usr/lib/python3.6/site-packages/pymoos.so</li>
  <li>/usr/lib64/python2.7/lib-dynload/pymoos.so</li>
  <li>/usr/lib64/python3.6/lib-dynload/pymoos.so</li>
  <li>/usr/local/lib/python3.7/lib-dynload/pymoos.so</li>
  </ul>
  
  <p>However, only python2.7 will allow me to 'import pymoos' from the interpreter. Attempting from either of the Python3 versions produces this:</p>
  
  <pre><code>Python 3.6.8 (default, Jun 11 2019, 15:15:01) 
  [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import pymoos
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: dynamic module does not define module export function (PyInit_pymoos)
  </code></pre>
  
  <p>The second dependency is pydantic, which I have only managed to install using pip3, apparently meaning that it's only available from either of the versions of Python3 that I have installed. Attempting to import from Python2 gives the following:</p>
  
  <pre><code>Python 2.7.5 (default, Jun 11 2019, 14:33:56) 
  [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux2
  Type "help", "copyright", "credits" or "license" for more information.
  &gt;&gt;&gt; import pydantic
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  ImportError: No module named pydantic
  </code></pre>
  
  <p>Since I know where the pymoos.so library is, I think that my easiest path forward is to put that in the right place so it works with python3, but I can't seem to find the right place!</p>