# Problem with installing with Python2

**URL:** <https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885>\
**Category:** pmx\
**Created:** [September 7, 2022, 4:08am UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885 "2022-09-07T04:08:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![s.pallav](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@s.pallav](https://ask.bioexcel.eu/u/s.pallav)\
**Post date:** [September 7, 2022, 4:08am UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/1 "2022-09-07T04:08:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![vgapsys](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@vgapsys](https://ask.bioexcel.eu/u/vgapsys)\
**Post date:** [September 7, 2022, 8:06am UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/2 "2022-09-07T08:06:04Z")

</div>

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:

```auto
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 .

```

---

<div class="post-metadata">

**Author:** ![s.pallav](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@s.pallav](https://ask.bioexcel.eu/u/s.pallav)\
**Post date:** [September 7, 2022, 1:40pm UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/3 "2022-09-07T13:40:52Z")

</div>

“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.

---

<div class="post-metadata">

**Author:** ![vgapsys](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@vgapsys](https://ask.bioexcel.eu/u/vgapsys)\
**Post date:** [September 7, 2022, 1:51pm UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/4 "2022-09-07T13:51:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![s.pallav](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@s.pallav](https://ask.bioexcel.eu/u/s.pallav)\
**Post date:** [September 7, 2022, 2:02pm UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/5 "2022-09-07T14:02:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![vgapsys](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@vgapsys](https://ask.bioexcel.eu/u/vgapsys)\
**Post date:** [September 7, 2022, 2:03pm UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/6 "2022-09-07T14:03:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![s.pallav](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@s.pallav](https://ask.bioexcel.eu/u/s.pallav)\
**Post date:** [September 7, 2022, 2:06pm UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/7 "2022-09-07T14:06:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![s.pallav](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@s.pallav](https://ask.bioexcel.eu/u/s.pallav)\
**Post date:** [September 7, 2022, 2:26pm UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/8 "2022-09-07T14:26:53Z")

</div>

`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

---

<div class="post-metadata">

**Author:** ![vgapsys](https://avatars.discourse-cdn.com/v4/letter/v/7993a0/32.png) [@vgapsys](https://ask.bioexcel.eu/u/vgapsys)\
**Post date:** [September 7, 2022, 2:29pm UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/9 "2022-09-07T14:29:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![s.pallav](https://avatars.discourse-cdn.com/v4/letter/s/5f8ce5/32.png) [@s.pallav](https://ask.bioexcel.eu/u/s.pallav)\
**Post date:** [September 7, 2022, 2:30pm UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/10 "2022-09-07T14:30:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![burunduk](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@burunduk](https://ask.bioexcel.eu/u/burunduk)\
**Post date:** [October 13, 2023, 7:22am UTC](https://ask.bioexcel.eu/t/problem-with-installing-with-python2/3885/11 "2023-10-13T07:22:32Z")

</div>

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
