Somehow I can't update my biopython module on my system. I currently have biopython v1.65 for python 2.7.6 installed. I want to update it, because some bugs in the Entrez-submodule have been fixed in the meantime.
So I tried updating with pip --install --upgrade biopython
.
Biopython 1.68 is downloaded, and the install begins. However I get this error message at the end:
[...]
error: could not delete '/usr/local/lib/python2.7/dist-packages/Bio/KEGG/Enzyme/__init__.py': Permission denied
----------------------------------------
Can't roll back biopython; was not uninstalled
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_john/biopython/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-JgDMcb-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_john/biopython
Traceback (most recent call last):
File "/usr/bin/pip2", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip2')()
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 235, in main
return command.main(cmd_args)
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 40: ordinal not in range(128)
So i thought, maybe I need admin rights to install my python modules (Can't remember how I originally installed them exactly, only that i used pip)?
So I tried again with sudo pip install --upgrade biopython
. Now I get no error message, just these warnings at the end:
[...]
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.py{}' found anywhere in distribution
warning: no previously-included files matching '*.py-e' found anywhere in distribution
Successfully installed biopython
Cleaning up...
When I then start a python shell and run
import Bio
print Bio.__version__
I still get version 1.65! So biopython was not updated at all! What am I doing wrong?
Could you check the python version and pip version you are using? e.g. use
which python
andwhich pip
to find out the path to the executableAlternatively, try running pip as:
(to make sure the correct python interpreter is combined with the correct pip)
Finally, I recommend using conda (and pip) from anaconda
Hi,
my pip version is: pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
my python version is Python 2.7.6
running pip per your suggestion gave me the same result
I guess i could create a virtual (Conda) python environment and try from within there, but basically it should work without that shouldn't it?
As I get it, I basically need Conda environments mostly if I want to switch easily between python versions (Which i never had to do to this day) or if you want to easily install dependencies without admin-rights (I am working on my own system and can "sudo" everything).
So until now I never felt the need to create virtual python environments on my system (I am using them on my institutes servers, however)
I agree, it should work. But having multiple python environments sure is troublesome. Is your python 2.7.6 also the one in /usr/lib/python2.7/?
Well the shebangs of the *.py files in that folder seem to point either directly to this python executable or to "/usr/bin/env python" which in turn also points to this python executable
Oh and isn't that pip version terribly outdated? We're currently at pip 9.0.1. Maybe updating that might also help...
I tried updating pip several times. Still end up with the same old pip version. Seems to be the same issue as with the biopython update. Probably some conflict with the "System-python" V2.6 and my own python 2.7 (although can't remember having any issue with that before)?
Anyway i ditched that completely and am now using Conda environments instead, as you suggested. Seems to be a good workaround.