pythonmodulebioinformaticsrosetta

No module named 'pyrosetta.rosetta'


I'm trying to install pyrosetta (after I downloaded the tar files and request for a license). I'm running on Ubuntu 20.04 in a virtual environment in Anaconda-navigator The installation step that I did are the following:

I compiled the rosetta in the base environment (rosetta_src_2021.16.61629_bundle release) I download the Pyrosetta PyRosetta4.MinSizeRel.python37.ubuntu.release-299 release I activated using conda activate env my virtual environment with 3.7.11 python. From the main PyRosetta directory, I did python setup/setup.py install and it succeded.

Installed /home/user/anaconda3/envs/BioCom/lib/python3.7/site-packages/pyrosetta-2017-py3.7-linux-x86_64.egg
Processing dependencies for pyrosetta==2017
Finished processing dependencies for pyrosetta==2017

(I also tried in the Rosetta directory under pyrosetta folder)

But when I start using python inside the env this error appears:

>>> from rosetta import *
>>> from pyrosetta import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/anaconda3/envs/BioCom/lib/python3.7/site-packages/pyrosetta-2017-py3.7-linux-x86_64.egg/pyrosetta/__init__.py", line 15, in <module>
    import pyrosetta.rosetta as rosetta
ModuleNotFoundError: No module named 'pyrosetta.rosetta'

I really dont' know what to do next, thank you!


Solution

  • I was facing the same issue. I solved it by exporting the directory to pyrosetta to my bashrc file.

    Step1: Enter source ~/.bashrc in your terminal. This should open up your .bashrc file.

    Step2: Add the following line to your bashrc:

    PATH=$PATH:<address/to/your/pyrosetta/directory>
    

    Step3: Save and close the .bashrc file. Use exec bash and then you try running your code again.