I have PyMOL already installed on my Linux machine. I know it is installed because when I write pymol -cp pymol_api_test.py the script executes.
I want to run the following python script using python3:
import pymol
from pymol import cmd
print(cmd.align("/home/bbq_spatial/bbq_input_pdb/pdb1a6j.pdb",
"/home/bbq_spatial/bbq_output_pdb/pdb1a6j.pdb",
cycles=0, transform=0))
However, it doesn't run when I call it using python3:
user_name@server_name:~$ nano pymol_api_test.py
user_name@server_name:~$ python3 pymol_api_test.py
Traceback (most recent call last):
File "pymol_api_test.py", line 1, in <module>
import pymol
ModuleNotFoundError: No module named 'pymol'
user_name@server_name:~$
How can I resolve this?
Install
conda(orpip) as a package manger for Python. And then installpymolwith the following commands:You can check your installed packages in your env with the following command:
Use this link to install conda on your Linux machine.
Pay attention,
PyMolmay require other dependencies on you system, check the official guides for installation.UPDATE:
Check a specific pkg:
with pip:
pip show <pkg>with conda:
conda show <pkg>List all installed pkgs:
with pip:
pip listwith conda:
conda list