Plugin development: how to install python packages

Hello, I am developing a chimerax plugin. My code will have some interaction with mdtraj. I need mdtraj to be installed in the python that ships with chimerax. I tried "chimerax -m pip install mdtraj" but I get all kinds of error dialogs popping up in the chimerax instance that gets launched during the installation. I terminate all the error dialogs and then exit chimerax (as the python install seems frozen) and then it indeed says installation has failed and gives unusual error messages (like setuptools was less than version 48.0.0 while chimerax reports it to be 65.x.y and even 66.x.y after upgrading). Can someone tell me the correct syntax to use to install mdtraj in chimerax's python? Thank you.

Hi Barry, I would discourage invoking pip from the ChimeraX executable. For plugin development, it’s best to add mdtraj as a dependency of your bundle. You can find documentation on how to do it here (XML) https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/bundle_info.html or here (TOML) https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/pyproject.html We use setuptools, so if you’re using TOML project metadata is as normal: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html Dependencies go in a user packages folder, which helps us ensure ChimeraX has internal integrity. You can also type “pip install mdtraj” into ChimeraX’s command line (this did not work for me, and I’ll open a ticket on our bug tracker with you CC'd) or, if you really have to get something into ChimeraX’s internal site-packages folder, run (on a Mac) “/path/to/ChimeraX.app/Contents/bin/python3.9 -I -m pip install mdtraj”. HTH, Zach Pearson Programmer, ChimeraX Team UCSF RBVI zjp@cgl.ucsf.edu
On Apr 24, 2023, at 14:33, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello,
I am developing a chimerax plugin. My code will have some interaction with mdtraj. I need mdtraj to be installed in the python that ships with chimerax. I tried "chimerax -m pip install mdtraj" but I get all kinds of error dialogs popping up in the chimerax instance that gets launched during the installation. I terminate all the error dialogs and then exit chimerax (as the python install seems frozen) and then it indeed says installation has failed and gives unusual error messages (like setuptools was less than version 48.0.0 while chimerax reports it to be 65.x.y and even 66.x.y after upgrading).
Can someone tell me the correct syntax to use to install mdtraj in chimerax's python? Thank you.
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Thanks for the pointers, Zach. I'll investigate this. ________________________________ From: Zach Pearson <zjp@cgl.ucsf.edu> Sent: Monday, April 24, 2023 5:13 PM To: BARRY E DEZONIA <barry.dezonia@wisc.edu> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Plugin development: how to install python packages Hi Barry, I would discourage invoking pip from the ChimeraX executable. For plugin development, it’s best to add mdtraj as a dependency of your bundle. You can find documentation on how to do it here (XML) https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/bundle_info.html or here (TOML) https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/pyproject.html We use setuptools, so if you’re using TOML project metadata is as normal: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html Dependencies go in a user packages folder, which helps us ensure ChimeraX has internal integrity. You can also type “pip install mdtraj” into ChimeraX’s command line (this did not work for me, and I’ll open a ticket on our bug tracker with you CC'd) or, if you really have to get something into ChimeraX’s internal site-packages folder, run (on a Mac) “/path/to/ChimeraX.app/Contents/bin/python3.9 -I -m pip install mdtraj”. HTH, Zach Pearson Programmer, ChimeraX Team UCSF RBVI zjp@cgl.ucsf.edu On Apr 24, 2023, at 14:33, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote: Hello, I am developing a chimerax plugin. My code will have some interaction with mdtraj. I need mdtraj to be installed in the python that ships with chimerax. I tried "chimerax -m pip install mdtraj" but I get all kinds of error dialogs popping up in the chimerax instance that gets launched during the installation. I terminate all the error dialogs and then exit chimerax (as the python install seems frozen) and then it indeed says installation has failed and gives unusual error messages (like setuptools was less than version 48.0.0 while chimerax reports it to be 65.x.y and even 66.x.y after upgrading). Can someone tell me the correct syntax to use to install mdtraj in chimerax's python? Thank you. _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu<mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Zach, I never received any email where I was CCed on a ticket. Did a ticket get created? If so can I be added so I can track progress? ________________________________ From: Zach Pearson <zjp@cgl.ucsf.edu> Sent: Monday, April 24, 2023 5:13 PM To: BARRY E DEZONIA <barry.dezonia@wisc.edu> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Plugin development: how to install python packages Hi Barry, I would discourage invoking pip from the ChimeraX executable. For plugin development, it’s best to add mdtraj as a dependency of your bundle. You can find documentation on how to do it here (XML) https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/bundle_info.html or here (TOML) https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/pyproject.html We use setuptools, so if you’re using TOML project metadata is as normal: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html Dependencies go in a user packages folder, which helps us ensure ChimeraX has internal integrity. You can also type “pip install mdtraj” into ChimeraX’s command line (this did not work for me, and I’ll open a ticket on our bug tracker with you CC'd) or, if you really have to get something into ChimeraX’s internal site-packages folder, run (on a Mac) “/path/to/ChimeraX.app/Contents/bin/python3.9 -I -m pip install mdtraj”. HTH, Zach Pearson Programmer, ChimeraX Team UCSF RBVI zjp@cgl.ucsf.edu On Apr 24, 2023, at 14:33, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote: Hello, I am developing a chimerax plugin. My code will have some interaction with mdtraj. I need mdtraj to be installed in the python that ships with chimerax. I tried "chimerax -m pip install mdtraj" but I get all kinds of error dialogs popping up in the chimerax instance that gets launched during the installation. I terminate all the error dialogs and then exit chimerax (as the python install seems frozen) and then it indeed says installation has failed and gives unusual error messages (like setuptools was less than version 48.0.0 while chimerax reports it to be 65.x.y and even 66.x.y after upgrading). Can someone tell me the correct syntax to use to install mdtraj in chimerax's python? Thank you. _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu<mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Hi Barry, Thanks for reminding me to make the ticket; you should get an email about it within the next few minutes. Zach Pearson Programmer, ChimeraX Team UCSF RBVI zjp@cgl.ucsf.edu
On May 1, 2023, at 10:09, BARRY E DEZONIA <barry.dezonia@wisc.edu> wrote:
Zach,
I never received any email where I was CCed on a ticket. Did a ticket get created? If so can I be added so I can track progress? From: Zach Pearson <zjp@cgl.ucsf.edu> Sent: Monday, April 24, 2023 5:13 PM To: BARRY E DEZONIA <barry.dezonia@wisc.edu> Cc: chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Plugin development: how to install python packages
Hi Barry,
I would discourage invoking pip from the ChimeraX executable. For plugin development, it’s best to add mdtraj as a dependency of your bundle. You can find documentation on how to do it here (XML)
https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/bundle_info.html
or here (TOML)
https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/pyproject.html
We use setuptools, so if you’re using TOML project metadata is as normal: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
Dependencies go in a user packages folder, which helps us ensure ChimeraX has internal integrity. You can also type “pip install mdtraj” into ChimeraX’s command line (this did not work for me, and I’ll open a ticket on our bug tracker with you CC'd) or, if you really have to get something into ChimeraX’s internal site-packages folder, run (on a Mac) “/path/to/ChimeraX.app/Contents/bin/python3.9 -I -m pip install mdtraj”.
HTH,
Zach Pearson Programmer, ChimeraX Team UCSF RBVI zjp@cgl.ucsf.edu
On Apr 24, 2023, at 14:33, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Hello,
I am developing a chimerax plugin. My code will have some interaction with mdtraj. I need mdtraj to be installed in the python that ships with chimerax. I tried "chimerax -m pip install mdtraj" but I get all kinds of error dialogs popping up in the chimerax instance that gets launched during the installation. I terminate all the error dialogs and then exit chimerax (as the python install seems frozen) and then it indeed says installation has failed and gives unusual error messages (like setuptools was less than version 48.0.0 while chimerax reports it to be 65.x.y and even 66.x.y after upgrading).
Can someone tell me the correct syntax to use to install mdtraj in chimerax's python? Thank you.
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu <mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

So if listing mdtraj as a dependency fails with the ChimeraX 1.6 release candidate, we'd like to know. It should work. There were bugs in earlier versions of ChimeraX for handling source code package dependencies. And they might not all be gone. So back to the fact that mdtraj is a source code distribution. It has the added complication that a C computer is required on the destination computer to install it. That is rarely true on Windows. And is not guaranteed to work on Linux and macOS. You need to say, that a C compiler is required, very prominently near the beginning of the description of your bundle. If there is no C compiler, there will be lots of installation errors that ChimeraX can't handle. So it would be much better that you included a precompiled version of mdtaj with your bundle. And distributed binary versions for Windows, Linux, and macOS. We can help you with that if need be. -- Greg On 4/24/2023 2:33 PM, BARRY E DEZONIA via ChimeraX-users wrote:
Hello,
I am developing a chimerax plugin. My code will have some interaction with mdtraj. I need mdtraj to be installed in the python that ships with chimerax. I tried "chimerax -m pip install mdtraj" but I get all kinds of error dialogs popping up in the chimerax instance that gets launched during the installation. I terminate all the error dialogs and then exit chimerax (as the python install seems frozen) and then it indeed says installation has failed and gives unusual error messages (like setuptools was less than version 48.0.0 while chimerax reports it to be 65.x.y and even 66.x.y after upgrading).
Can someone tell me the correct syntax to use to install mdtraj in chimerax's python? Thank you.
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users

Thanks Greg, My tool will probably be Linux only as some of its dependencies are Linux only projects. So I might just let the users know it requires a C compiler in the project description and allow users to install one since that is not hard. Once I figure out how to include mdtraj in my project I will download 1.6 rc (I have 1.5 rc) and let you know if it has problems with mdtraj. ________________________________ From: Greg Couch <gregc@cgl.ucsf.edu> Sent: Monday, April 24, 2023 5:16 PM To: BARRY E DEZONIA <barry.dezonia@wisc.edu>; chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Plugin development: how to install python packages So if listing mdtraj as a dependency fails with the ChimeraX 1.6 release candidate, we'd like to know. It should work. There were bugs in earlier versions of ChimeraX for handling source code package dependencies. And they might not all be gone. So back to the fact that mdtraj is a source code distribution. It has the added complication that a C computer is required on the destination computer to install it. That is rarely true on Windows. And is not guaranteed to work on Linux and macOS. You need to say, that a C compiler is required, very prominently near the beginning of the description of your bundle. If there is no C compiler, there will be lots of installation errors that ChimeraX can't handle. So it would be much better that you included a precompiled version of mdtaj with your bundle. And distributed binary versions for Windows, Linux, and macOS. We can help you with that if need be. -- Greg On 4/24/2023 2:33 PM, BARRY E DEZONIA via ChimeraX-users wrote: Hello, I am developing a chimerax plugin. My code will have some interaction with mdtraj. I need mdtraj to be installed in the python that ships with chimerax. I tried "chimerax -m pip install mdtraj" but I get all kinds of error dialogs popping up in the chimerax instance that gets launched during the installation. I terminate all the error dialogs and then exit chimerax (as the python install seems frozen) and then it indeed says installation has failed and gives unusual error messages (like setuptools was less than version 48.0.0 while chimerax reports it to be 65.x.y and even 66.x.y after upgrading). Can someone tell me the correct syntax to use to install mdtraj in chimerax's python? Thank you. _______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu<mailto:ChimeraX-users@cgl.ucsf.edu> Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
participants (3)
-
BARRY E DEZONIA
-
Greg Couch
-
Zach Pearson