Problem with installing with Python2

Dear all,
I am encountering problem with installing pmx with Python2.7 which has a problem with matplotlib version. Has anyone come across such sort of problem? I wanted to use the scripts from the master branch particularly the scripts used in ligands.
Moreover, to not to break the pmx compiled from the develop branch, I tried compiling it in a separate conda environment yet it doesn’t work?

Could you show what error exactly you get?

I just tested in a clean conda environment, but couldn’t reproduce the error. Here are the commands that I used:

conda create -n pmx_python2 python=2.7
conda activate pmx_python2
conda install numpy matplotlib scipy pip jupyter pandas
python -m pip install --upgrade pip
git clone https://github.com/deGrootLab/pmx
cd pmx
pip install .

“pip install .” leads to,
ERROR: Package ‘pmx’ requires a different Python: 3.8.10 not in ‘>=2.7, <3’
I followed the same steps as you mentioned.

It seems that you are trying to compile pmx which requires python3. Are you sure that you checked out the ‘master’ branch?

Do I have to explicity do that as in “git checkout master”?

Yes, if your current branch is not ‘master’, you need to checkout ‘master’

1 Like

okay I will do that. But I am already in master branch.

pip install . didn’t work but python2 setup.py install method did work. For what reasons pip didn’t work I could not understand that.
Regards,
Thanks a lot,
Pallav

Could it be that the pip which you were using was not compiled in the current conda environment, but was taken from somewhere else in your PYTHONPATH and was compiled with python3?

Yes it should be the reason. Let me check that. Thanks a lot.

Hi,

I’m reviving this topic because I have a problem with a python2 installation, though a bit different.
I installed python2.7 and pip2.7 specially for the pmx installation (python3 installation seemed to be successful but without the data directory).
Already on ‘master’
With python2.7 setup.py install the error message is:
pmx/extensions/pmx/pmx.h:32:10: fatal error: Python.h: No such file or directory

with sudo pip2.7 install . error is lengthy, ending with:
ERROR: Command errored out with exit status 1: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-req-build-vvSwb8/setup.py'"'"'; __file__='"'"'/tmp/pip-req-build-vvSwb8/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-JQ6KS3/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python2.7/pmx Check the logs for full command output.

while
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/dist-packages (44.1.1)

What else I could try? Thank you in advance,
Sofya