I want to install the Biopython module. So I used the command sudo apt-get install python-biopython
. That installs the package. Now if I type import Bio
in Python, the compiler cannot find the module giving ImportError: no module named Bio
. Doesn't installing the package imply installing the module?
Asked
Active
Viewed 88 times
1

Faustus
- 267
- 4
- 8
-
did you try import biopython – The6thSense May 20 '15 at 04:58
-
@Vignesh `import biopython` also gives the same import error `no module named 'biopython'` – Faustus May 20 '15 at 04:59
-
What python version are you using? Currently `apt-get install` will install the python2 version. – Martin Konecny May 20 '15 at 05:04
-
@Martin I'm using 3.4.0 – Faustus May 20 '15 at 05:08
1 Answers
5
I'm using 3.4.0
Since you are using Python 3.4 it won't work because the Debian package you install via apt-get
will only install the Python2.x version.
To install the Python 3 version, I recommend pip. Here how to install (Note that this package may not have a Python 3 version):
How to install pip with Python 3?
EDIT:
If you still cannot get the import
working on python2, try the following:
import sys
sys.path.append('/usr/share/pyshared')
import Bio
According to this package's files list, the files are installed into a special directory I don't see in the default sys.path
list

Community
- 1
- 1

Martin Konecny
- 57,827
- 19
- 139
- 159