Hi, I apologize sincerely since I imagine this comes up often on the
mailing list.
I'm basically wondering if it's possible to import just the `core`
functionality from a chimerax installation into a custom python environment
and bypass the GUI and the binary completely.
Example: I don't think it matters whether it's linux, mac, or source build,
but let's say i installed a clean chimerax via my package manager (`yay i
chimerax`). It's at `/opt/chimerax` and looks like this:
(venv) ᢹ ritual.rtviii[ /opt/chimerax ] ls -la
total 24
drwxr-xr-x 6 root root 4096 May 1 16:08 .
drwxr-xr-x 10 root root 4096 May 1 16:58 ..
drwxr-xr-x 4 root root 4096 May 1 16:51 bin
drwxr-xr-x 8 root root 4096 May 1 16:51 include
drwxr-xr-x 4 root root 4096 May 1 16:51 lib
drwxr-xr-x 6 root root 4096 May 1 16:51 share
If I launch `chimerax` at the command line, i get a functional GUI etc. It
works. I create a fresh custom `virtualenv` with the same python that this
chimerax ships:
virtualenv --python='/opt/chimerax/bin/python3.11' venv
Then i do something ugly in the name of science: i symlink the chimerax
folder from the installation into my virtualenv:
ln -s /opt/chimerax/lib/python3.11/site-packages/chimerax
/home/rtviii/dev/try_chimerax/venv/lib/python3.11/site-packages/chimerax
i also tried:
for P in $(ls /opt/chimerax/lib/python3.11/site-packages/); do ln -s
/opt/chimerax/lib/python3.11/site-packages/$P /home/rtviii/dev/try_chimerax/
venv/lib/python3.11/site-packages/$P; done
This enables me to import chimerax modules into my python code that uses
this virtualenv:
```/home/rtviii/dev/try_chimerax/test.py
from chimerax.core.commands import run
from chimerax.core.session import Session
import chimerax.mmcif.mmcif as mmcif
s = Session("Hi")
print(s)
run(s,"open 1ubq.cif")
```
However, this is where i'm struggling a little to use any actual
functionality (especially interested in cutting, merging structures and
operations treating density maps and mmcif structures) because the Session
wouldn't initialize well:
```