When I try,
from Bio.Alphabet import IUPAC
from Bio import Seq
my_prot = Seq("AGTACACTGGT", IUPAC.protein)
Why do I encounter the following error:
TypeError: 'module' object is not callable
PS: this is an Example from the BioPython’s Cookbook
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In the BioPython source code the “Seq” class is located in the file “Seq.py” in the path “/Seq/Seq.py”
Meaning… You need to import Seq (a file) which means its a “Module” and then call the class “Seq” within the ‘Module’ ‘Seq’
So try this:
If you are ever confused in Python about what you are importing and what you are calling you can do this: