Subham,
You should be able to add those Python package dependencies to your bundle, and then when the bundle is installed, your dependencies will be installed as well. If not, that is a bug and we'll fix it. ChimeraX bundles are essentially Python wheels with ChimeraX-specific metadata.
There is a major issue with Python package dependencies.
Ideally, they should be pure Python or platform-specific binary
wheels. Source code wheels or tarballs, that need to be compiled,
will not work on almost all Windows systems because they do not
have a compiler installed. And the same problem exists for macOS
and Linux to a slightly lesser extent. The solution is to
precompile your dependencies and include the binaries in your
bundle -- ideally the same way setuptools includes other Python
packages that might or might not be installed separately.
Another issue is if you change your bundle's dependencies while developing your bundle, you should change the version number. That is because, due to how pip works, reinstalling a bundle with the same version number skips installing the dependencies.
HTH,
Greg
Shubham,
I can't think of any issues that could arise from installing packages this way, but a ChimeraX developer might know more about all the types of environments people are using.
I just want to mention that ChimeraX does have a pip command (I think it was added in 1.5), so you could pretty easily make a .cxc file with all the `pip install X` you need. This might be simpler for users, as they wouldn't have to modify your scripts - just start up ChimeraX (GUI or --nogui) and `open requirements.cxc`.
Best,
Tony
On Wed, May 3, 2023 at 9:06 AM Shubham Devesh Ramgoolam via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
_______________________________________________Dear ChimeraX team,
I have some python scripts for performing computation using chimeraX in the nogui mode.
Those scripts rely on packages not available in the python environment of chimeraX and I installed them using:
ChimeraX-console.exe -m pip install add_package --user
I intend to distribute my scripts to other users and they will also need to install these packages.
As such, I have written another python script to automate the installation of these packages (the path to ChimeraX-console.exe (if Windows) or ChimeraX.exe (if Mac) must be supplied in a text file for this to work). The heart of the automation script is as follows:
for item in list_packages:
subprocess.call([path_chimeraX, '-m', 'pip', 'install', item, '--user'])
Is this approach of installing python modules in chimeraX valid, considering that different users may have a different environment for their chimeraX? (I am worried that pip install might not work on some setups.)
Regards,
Shubham Ramgoolam
Sent from Mail for Windows
ChimeraX-users mailing list
ChimeraX-users@cgl.ucsf.edu
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users
_______________________________________________ ChimeraX-users mailing list ChimeraX-users@cgl.ucsf.edu Manage subscription: https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users