Hi everyone,
I installed the modeller program on my computer. I'm running a Lubuntu 32-bit system. I have python installed. I can check that by running python --version
on a terminal. However whenever I run a script that has modeller functions in it, like executing this script: python model-default.py > model-default.log
it's giving me this result:
Traceback (most recent call last):
File "model-default.py", line 4, in <module>
from modeller import * # Load standard Modeller classes
ImportError: No module named modeller
What should I do in order to be able to import modeller inside my python scripts? Also is there an easy API for modeller so that I can run it in java? Thank you.
I see, whenever I do
echo $PYTHONPATH
on a terminal in LUBUNTU it's just returning me blank.by the result of this I'm assuming that the
PYTHONPATH
isn't set up, even though I've added those two folders inside Modeller to pythonpath couple of times, so each time it's resetting for some reason by the looks of it.this script that you posted, should I copy them inside my scripts? if yes to which script should I copy it? I didn't understand what a
.bashrc
scipt is. Thank you.I copied the above code in all my .bashrc scripts. basically I did a
locate .bashrc
command in a terminal and it returned me with this:Not knowing what exactly these .bashrc scripts do exactly, I've copy pasted the code that you stated in the above answer in all of the scripts ending with the extension .bashrc after that I executed the command:
python model-default.py
after becoming root. the command did execute and was able to locate the modeller library. Thank you.Now I'm downloading Spyder Anaconda to use it as an IDE to develop my python scripts. I hope that the python compilers that are installed with anaconda do not conflict with the existing python compiler and I will be able to import Modeller libraries using the spyder IDE for python.
Anaconda is a package manager and Spyder an IDE. I'd try to find something that ties everything together, such as PyCharm so that you don't run into problems and make your life easier.
All right. I've removed that piece of code from all the scripts with the extension .bashrc except the ones located under the folder with my name as you said:
After that I issued a command
python model-default.py
and it ran normallyThank you for this.
Concerning Anaconda and spyder, when I opened this exact script that I ran through the terminal (model-default.py) using spyder and clicked run it returned me this as an output inside the shell:
However later on I changed the setting from spyder by going to: run >> configure >> under the interpreter section I chose "Execute in a new dedicated Python interpreter" rather than "Execute in current Python or IPython interpreter" which was selected by default. after I did this change and re-ran the script it ran normally and returned exactly the same output as it did in the case of running the same script using a terminal. I don't understand the reason to this. Is it wrong for me to change the interpreter setting that I mentioned and run it? Thank you.