Please have mercy on me. I'm from the R universe and recently inherited a project in python. It's been about two years since I've had to work with python, so I'm probably missing something obvious. And I'll do my best for a reprex if anyone should deem it necessary.
I have an anaconda environment running on ubuntu 20.04. I've activated the environment and then installed biopython. However, whenever I run the script file in question, I get a ModuleNotFoundError
. Here's the full error:
from Bio import SeqIO ModuleNotFoundError: No module named 'Bio'
After doing some digging, turns out Bio
is actually within biopython
, and when I run conda list | grep 'Bio'
I get nothing as output. However, when I run conda list | grep 'bio'
here's the output.
# packages in environment at /home/user/anaconda3/envs/bioPy: biopython 1.78 py38h7b6447c_0
Here's the output from which python3
/home/user/anaconda3/envs/bioPy/bin/python3
I also fired up the interpreter directly, from within the active environment then ran import Bio
then used the methods I wanted to use, and had no issues. But if I tried to import biopython
I get a ModuleNotFoundError
. So I'm pretty sure that Bio
is what I actually need for the script to run
I read in this post about manually changing the name of the package directory in the site-packages directory located at /home/user/anaconda3/lib/python3.x/site-packages
. Seemed far-fetch, but didn't make a difference because the directory was already named 'Bio' in site-packages.
I see from the biopython website that Bio
is the API for the biopython project, and that the particular piece of code I want is a separate package within the API (SeqIO).
So here's my question. How is one supposed to get methods from within the Bio
package imported into a python script?