1

i have installed on my Ubuntu, this package: pyinteraph.py after the installation, i have this problem:

File "/home/user/Scrivania/PyInteraph-1.0/test/pyinteraph/pyinteraph", line 162, in <module>
 from libinteract import libinteract as li
  File "/home/user/Scrivania/PyInteraph-1.0/test/lib/python/libinteract/libinteract.py", line 8, in <module>
    from innerloops import LoopDistances
ImportError: /home/user/Scrivania/PyInteraph-1.0/test/lib/python/libinteract/innerloops.so: undefined symbol: sqmI

I have no idea how to fix it

kennyvh
  • 2,526
  • 1
  • 17
  • 26
  • how did you install this package? – kennyvh Jan 20 '20 at 18:40
  • I followed the instructions, written in the INSTALL file: python setup.py install – Pietro Delre Jan 20 '20 at 18:46
  • It looks like you need to install some other dependencies too. Did you follow the instructions [here](https://github.com/ELELAB/pyinteraph/blob/master/INSTALL)? – kennyvh Jan 20 '20 at 18:47
  • yes they are. But i have a problem with the Install of the prerequisites. When i do this command: sudo apt-get install python-dev python-cython python-numpy g++ gcc appear: E: Impossibile trovare il pacchetto python-cython (python-cython not found) – Pietro Delre Jan 20 '20 at 18:51
  • maybe try without the `python-cython` package? – kennyvh Jan 20 '20 at 19:02
  • ok... but appear that i have installed both g++ and gcc :( – Pietro Delre Jan 20 '20 at 19:12
  • the error remains – Pietro Delre Jan 20 '20 at 19:38
  • what version is your `MDAnalysis`? the installation instructions specify to use version < 0.8. Can you verify that this is the case for you? – kennyvh Jan 20 '20 at 19:46
  • now, i have uninstalled MDAnalysis and re-install MDAnalysis=0.7.6 (how write in the istruction) but i have an error: from MDAnalysis.analysis.distances import distance_array File "/home/z4-19/.local/lib/python2.7/site-packages/MDAnalysis/analysis/distances.py", line 31, in from scipy import weave ImportError: cannot import name weave – Pietro Delre Jan 20 '20 at 19:58
  • see my answer below: it's a little hacky, but you'll have to edit a couple lines in the MDAnalysis file here: `/home/z4-19/.local/lib/python2.7/site-packages/MDAnalysis/analysis/distances.py`. see step 10 and replace the path with the path of the file in your error message. You will also need to `pip install weave` – kennyvh Jan 20 '20 at 20:03
  • yes, work. but i have the same problem, after run tutorial.sh – Pietro Delre Jan 20 '20 at 21:41
  • same problem? `cannot ipmort name weave`? – kennyvh Jan 20 '20 at 21:48
  • no this one: File "/home/user/Scrivania/PyInteraph-1.0/test/pyinteraph/pyinteraph", line 162, in from libinteract import libinteract as li File "/home/user/Scrivania/PyInteraph-1.0/test/lib/python/libinteract/libinteract.py", line 8, in from innerloops import LoopDistances ImportError: /home/user/Scrivania/PyInteraph-1.0/test/lib/python/libinteract/innerloops.so: undefined symbol: sqmI – Pietro Delre Jan 20 '20 at 21:53

1 Answers1

2

I was able to install and get it working on my machine with a few tweaks... It's definitely not ideal, hopefully the package maintainers can update the installation instructions.

Here's what I did:

  1. make a new directory for your project, mkdir myproj
  2. change directories into your new directory cd myproj
  3. create new virutalenv virtualenv --python=python2.7 venv
  4. activate virutalenv source venv/bin/activate
  5. pip install numpy scipy matplotlib networkx weave
  6. pip install MDAnalysis==0.7.6
  7. Clone the pyinteraph repo: git clone https://github.com/ELELAB/pyinteraph.git
  8. cd pyinteraph
  9. python setup.py install
  10. (this is where it gets a little hacky...) because of this issue here with scipy, we need to edit the MDAnalysis file to import weave instead of scipy.weave. Change a couple lines in the file venv/lib/python2.7/site-packages/MDAnalysis/analysis/distances.py from:
import numpy
from scipy import sparse
from scipy import weave
from scipy.weave import converters

to

import numpy
from scipy import sparse
#  from scipy import weave
#  from scipy.weave import converters

import weave
from weave import converters

Then to check if it is working, open up a python shell and try:

from libinteract import libinteract

If there are no errors, you are good to go.

EDIT: the maintainers have a py3 version available here

kennyvh
  • 2,526
  • 1
  • 17
  • 26
  • could you try if you are able to run tutorial.sh in examples? – Pietro Delre Jan 20 '20 at 20:37
  • when i check from libinteract import libinteract i have this error :( :( Traceback (most recent call last): File "", line 1, in File "/home/z4-19/Scrivania/pietro/pyinteraph-master/examples/myproj/venv/local/lib/python2.7/site-packages/libinteract/libinteract.py", line 8, in from innerloops import LoopDistances ImportError: /home/z4-19/Scrivania/pietro/pyinteraph-master/examples/myproj/venv/local/lib/python2.7/site-packages/libinteract/innerloops.so: undefined symbol: sqmI – Pietro Delre Jan 20 '20 at 21:57
  • i believe this `sqml` error is related to the version of MDAnalysis. Can you `pip list` and verify the version is correct? when you are running python, are you using the correct python interpreter? – kennyvh Jan 20 '20 at 22:04
  • MDAnalysis (0.7.6) – Pietro Delre Jan 21 '20 at 08:23
  • this is inside the virtualenv, correct? i believe you were on the right track when you were receiving the `weave` error. is it possible for you to recreate that? – kennyvh Jan 21 '20 at 17:20
  • 1
    Do you really need MDAnalysis 0.7.6 – this is a terribly outdated version; the current one (January 2020) is 0.20.1. Modern versions of Python [install easily with conda or pip](https://www.mdanalysis.org/pages/installation_quick_start/). EDIT: According to issue [ELELAB/pyinteraph #4](https://github.com/ELELAB/pyinteraph/issues/4#issuecomment-576600909) it does need MDAnalysis 0.7.6 and they are working on upgrading. I would say your best shot is a virtual environment full of old versions of Python, numpy, scipy, MDAnalysis. – orbeckst Jan 21 '20 at 23:31