Nathan,

Many GUI elements use the `run` function you mentioned, so it should be there if you aren't having major issues with the GUI. I suspect the problem has to do with how you are running your code.

ChimeraX uses its own Python interpreter and module directory, so your system Python won't be able to import chimerax modules. Make sure you're running your code by entering it in the shell (Tools -> General -> Shell), opening the Python script in ChimeraX (using the open command or menu options), or packaging it as a bundle and installing it in ChimeraX.

Best,

Tony




From: ChimeraX-users <chimerax-users-bounces@cgl.ucsf.edu> on behalf of Nathan Wood via ChimeraX-users <chimerax-users@cgl.ucsf.edu>
Sent: Tuesday, June 29, 2021 10:25 PM
To: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu>
Subject: [chimerax-users] Python API Inquiry
 
[EXTERNAL SENDER - PROCEED CAUTIOUSLY]

To Whom it May Concern,


My name is Nathan Wood and I am currently a Google Summer of Code Intern with the OpenChemistry Group. Currently I am currently in the process of replacing Visualizing Molecular Dynamics (VMD) with ChimeraX as a means to visualizing computationally generated electrostatic potential diagrams. To accomplish this I am having to use the Python API in a script.


However, I am having difficulties enabling the Python API. When I execute a Tutorials example found in the online developer's documentation, I receive the error:

ImportError: No module named chimerax.core.commands

which suggests that the python modules were never installed properly. I also recieve similar errors when attempting to import the toolshed.

Otherwise, the ChimeraX GUI and its shell work properly and I am unsure how to resolve the API error.

I am currently using the Generic Linux 64 Bit Daily Release and can provide more information if necessary.


Any assistance would be greatly appreciated

------------------------------------------------------

Very Respectfully,

Nathan Wood

Undergraduate Year 3, GSOC Intern

University of Florida