<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Nathan,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I can't say why you're getting interpreter error. I think ChimeraX has to start up in order to set its package install destination, which might be why packages installed from the interpreter can't be found by ChimeraX.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
You can try using `/path/to/ChimeraX-console -m pip install X`</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
You might also be able to download the package's .whl file from PyPI/conda and install it with the
<code>toolshed install /path/to/some.whl</code>​ ChimeraX command - I've never tried this. However, the bundle API has a straightforward way of requesting other packages to be installed.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Bundles are easy to distribute, and you can list dependencies that will automatically be installed from PyPI when someone installs your bundle. There are examples and tutorials for creating a bundle on the developer tutorial you mentioned in your previous thread:
<a href="https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/introduction.html" id="LPlnk">
https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/introduction.html</a><br>
</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview _EReadonly_1"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
As an example of how easy it is to specify PyPI dependencies for a bundle, here's some sections from the bundle_info.xml from my TestManager bundle:</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
```</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace;">​<BundleInfo name="ChimeraX_TestManager"
<br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace;">...some other stuff...</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace;"></span><span style="font-family: Consolas, Courier, monospace;">            <Dependencies></span>
<div><span style="font-family: Consolas, Courier, monospace;">                <Dependency name="ChimeraX-Core" version=">=1.1"/></span></div>
<div><span style="font-family: Consolas, Courier, monospace;">                <Dependency name="flake8"/></span></div>
<div><span style="font-family: Consolas, Courier, monospace;">                <Dependency name="pyflakes"/></span></div>
<div><span style="font-family: Consolas, Courier, monospace;">                <Dependency name="mypy"/></span></div>
<div><span style="font-family: Consolas, Courier, monospace;">                <Dependency name="pydocstyle"/></span></div>
<div><span style="font-family: Consolas, Courier, monospace;">            </Dependencies></span><br>
</div>
<div><span style="font-size:12pt"><span style="font-family:Consolas, Courier, monospace">...some more stuff...</span></span><br>
</div>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
```</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Now, whenever someone installs my TestManager bundle from the Toolshed or the .whl file, ChimeraX will go install flake8, pyflakes, mypy, and pydocstyle from PyPI as well. This is much easier for everyone involved than having to install all the dependencies
 manually.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
If one of your dependencies is only on conda, perhaps you can package it with your bundle. The bundle_info.xml supports adding more modules to your bundle with the AdditionalPackages tag. Here's the full list of supported bundle_info.xml tags:
<a href="https://www.rbvi.ucsf.edu/chimerax/docs/devel/tutorials/bundle_info.html" id="LPlnk">
https://www.rbvi.ucsf.edu/chimerax/docs/devel/tutorials/bundle_info.html</a><br>
</div>
<div class="_Entity _EType_OWALinkPreview _EId_OWALinkPreview_1 _EReadonly_1"></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Tony<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> ChimeraX-users <chimerax-users-bounces@cgl.ucsf.edu> on behalf of Nathan Wood via ChimeraX-users <chimerax-users@cgl.ucsf.edu><br>
<b>Sent:</b> Monday, July 5, 2021 9:16 PM<br>
<b>To:</b> chimerax-users@cgl.ucsf.edu <chimerax-users@cgl.ucsf.edu><br>
<b>Subject:</b> [chimerax-users] Python/Pip Inquiry - ChimeraX - Nathan Wood</font>
<div> </div>
</div>
<div><font color="BA0C2F">[EXTERNAL SENDER - PROCEED CAUTIOUSLY]</font><br>
<br>
<div>
<p>Dear ChimeraX <br>
</p>
<p><br>
</p>
<p>With regards to the python and pip utilities organic to ChimeraX, is it possible to use the conda installed modules within the same script executed by ChimeraX? When running the script through ChimeraX I return an error that the module is not found.
<br>
</p>
<p>The module was installed using "pip install -e . " while in the conda environment. When I attempted this using the pip provided in ChimeraX Daily Release (22/06/2021, Generic X64 Linux) I return the error:</p>
<p><i>"/tmp/chx-develop.eKjBho/ChimeraX.app/bin/python3.8: bad interpreter: No such file or directory"</i></p>
<p>This error can be resolved if I modify the <i>"#!"</i> at the beginning of the pip in a text editor to the python3.8 found within ChimeraX, with pip installing correctly, but ChimeraX still returning that the module is not found. Furthermore I believe this
 method is not sound. <br>
</p>
<p><br>
</p>
<p>Any assistance would be appreciated<br>
</p>
<p><br>
</p>
<p>Very Respectfully,</p>
<p>Nathan Wood <br>
</p>
<p><br>
</p>
</div>
</div>
</body>
</html>