Plugin development questions

Hello, I have been developing a plugin in bits and pieces for a while. I am now hoping to build a bundle (or whatever) to make installation pretty seamless. My program is a bit unconventional so I have a few questions on how to proceed. My plugin templating copies one of the examples (maybe the Tool example). My plugin uses a couple of python packages/modules: * mdtraj (https://mdtraj.org/1.9.3/installation.html) * traj2nmr (https://github.com/weberdak/traj2nmr) It also will have some shell scripts I want to include and also a java program. So far we have been getting by installing things like this: * in chimerax using the command prompt entering "pip install mdtraj" or similar * from an OS terminal invoking chimerax's version of python to run traj2nmr's setup.py program so that it goes into chimerax's python's installed packages * including our shell scripts in a Runnable directory under the plugin installation directory (during development) and copying them in a similar directory under the ~/.local/share/....chimerax-path-stuf.../the-plugins-Runnable-dir. Maybe the plugin installation process does this for me already but it is often not showing the latest changes even after plenty of "dev installs" in the chimerax command prompt line. * I am just starting to want to place the java app and the shell script that launches it somewhere. Hopefully in that same Runnable directory. Right now, I am trying to learn what is the best approach to bundle this all together and have a simple installation process. Can someone advise a bit? Thanks.

Barry, Someone else might be able to give advice for shell scripts and java, but you can include python dependencies in your bundle_info.xml file. For pip-installable modules, you can just include the names and versions in a Dependencies group in the bundle_info.xml. When someone installs your bundle, ChimeraX will go grab all the dependencies automatically. For things not on PyPI, you could include them as an additional package, provided the module's license is compatible with yours. You'll have to specify the path to the package's source code on your computer, and they'll get packaged alongside your bundle. I use both dependencies and additional packages in SEQCROW. SEQCROW's bundle_info.xml is here: https://github.com/QChASM/SEQCROW/blob/master/bundle_info.xml#L68. The additional packages are listed towards the bottom. The ChimeraX bundle_info doc has more details: https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/bundle_info.html. I'm guessing the TOML files support similar options if you're using that. Hope that helps, Tony On Fri, Aug 11, 2023 at 2:43 PM BARRY E DEZONIA via ChimeraX-users < chimerax-users@cgl.ucsf.edu> wrote:
Hello,
I have been developing a plugin in bits and pieces for a while. I am now hoping to build a bundle (or whatever) to make installation pretty seamless. My program is a bit unconventional so I have a few questions on how to proceed.
My plugin templating copies one of the examples (maybe the Tool example).
My plugin uses a couple of python packages/modules:
- mdtraj (https://mdtraj.org/1.9.3/installation.html) - traj2nmr (https://github.com/weberdak/traj2nmr)
It also will have some shell scripts I want to include and also a java program.
So far we have been getting by installing things like this:
- in chimerax using the command prompt entering "pip install mdtraj" or similar - from an OS terminal invoking chimerax's version of python to run traj2nmr's setup.py program so that it goes into chimerax's python's installed packages - including our shell scripts in a Runnable directory under the plugin installation directory (during development) and copying them in a similar directory under the ~/.local/share/....chimerax-path-stuf.../the-plugins-Runnable-dir. Maybe the plugin installation process does this for me already but it is often not showing the latest changes even after plenty of "dev installs" in the chimerax command prompt line. - I am just starting to want to place the java app and the shell script that launches it somewhere. Hopefully in that same Runnable directory.
Right now, I am trying to learn what is the best approach to bundle this all together and have a simple installation process. Can someone advise a bit? Thanks.
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Hi Barry, Tony offers some good advice. One problem is that mdtraj is only available to pip install as a binary on Mac -- on Windows and Linux it will have to be compiled from source so the user will have to have a compilation environment installed. The two options I can think of are: 1) Compile the mdtraj module yourself and offer 3 different platform-specific wheels for your bundle. 2) Warn the user that they need to have a compilation environment installed on Windows/Linux to use your bundle. Neither are ideal. As for traj2nmr, I don't think there are any install-time hooks for running arbitrary commands, but when your package starts up it could check whether the traj2nmr executable is importable and if it's not then install it using sys.executable, which will be ChimeraX rather than python itself, but you could use the "--nogui --script path/to/setup.py --exit" flags to install using ChimeraX. Note that on Windows sys.executable will end with "ChimeraX.exe" but you will need to change that to "ChimeraX-console.exe" in order to run it as a command-line program. You would include traj2nmr as an additional package, as Tony outlined. As for the-plugins-Runnable-dir, use the DataFiles tag and its DataDir child element to get that directory and all its contents copied into your installation, e.g.: <DataFIles> <DataDir>the-plugins-Runnable-dir</DataDir> </DataFiles> --Eric Eric Pettersen UCSF Computer Graphics Lab
On Aug 11, 2023, at 2:18 PM, Tony Schaefer via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Barry,
Someone else might be able to give advice for shell scripts and java, but you can include python dependencies in your bundle_info.xml file.
For pip-installable modules, you can just include the names and versions in a Dependencies group in the bundle_info.xml. When someone installs your bundle, ChimeraX will go grab all the dependencies automatically. For things not on PyPI, you could include them as an additional package, provided the module's license is compatible with yours. You'll have to specify the path to the package's source code on your computer, and they'll get packaged alongside your bundle. I use both dependencies and additional packages in SEQCROW. SEQCROW's bundle_info.xml is here: https://github.com/QChASM/SEQCROW/blob/master/bundle_info.xml#L68 <https://github.com/QChASM/SEQCROW/blob/master/bundle_info.xml#L68>. The additional packages are listed towards the bottom. The ChimeraX bundle_info doc has more details: https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/bundle_info.html <https://www.cgl.ucsf.edu/chimerax/docs/devel/tutorials/bundle_info.html>. I'm guessing the TOML files support similar options if you're using that.
Hope that helps,
Tony
On Fri, Aug 11, 2023 at 2:43 PM BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote: Hello,
I have been developing a plugin in bits and pieces for a while. I am now hoping to build a bundle (or whatever) to make installation pretty seamless. My program is a bit unconventional so I have a few questions on how to proceed.
My plugin templating copies one of the examples (maybe the Tool example).
My plugin uses a couple of python packages/modules: mdtraj (https://mdtraj.org/1.9.3/installation.html <https://mdtraj.org/1.9.3/installation.html>) traj2nmr (https://github.com/weberdak/traj2nmr <https://github.com/weberdak/traj2nmr>)
It also will have some shell scripts I want to include and also a java program.
So far we have been getting by installing things like this: in chimerax using the command prompt entering "pip install mdtraj" or similar from an OS terminal invoking chimerax's version of python to run traj2nmr's setup.py program so that it goes into chimerax's python's installed packages including our shell scripts in a Runnable directory under the plugin installation directory (during development) and copying them in a similar directory under the ~/.local/share/....chimerax-path-stuf.../the-plugins-Runnable-dir. Maybe the plugin installation process does this for me already but it is often not showing the latest changes even after plenty of "dev installs" in the chimerax command prompt line. I am just starting to want to place the java app and the shell script that launches it somewhere. Hopefully in that same Runnable directory. Right now, I am trying to learn what is the best approach to bundle this all together and have a simple installation process. Can someone advise a bit? Thanks.
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/ <https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/> _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Thanks for the help Eric. I am pretty close to everything working but I think this traj2nmr install approach might be a dead end. In my chimerax tool I have this at the beginning: if importlib.util.find_spec('traj2nmr') is None: app_dir = pathlib.Path(__file__).parent.resolve() subprocess.run(["python3", app_dir / 'Installable' / 'install_traj2nmr.py', sys.executable]) Then in my install_traj2nmr.py file that gets called by the above code I have this: this_files_dir = pathlib.Path(__file__).parent.resolve() chimerax = sys.argv[1] os.system(f"cd {this_files_dir}/traj2nmr; {chimerax} --nogui --script 'setup.py install' --exit") And it ALMOST works. Unfortunately it seems that I might need sudo access to run that command. This is the info Chimera gives back when it tries to run my code: /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. dist.fetch_build_eggs(dist.setup_requires) running install /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 13] Permission denied: '/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/test-easy-install-134656.write-test' There is a paragraph of explanation saying maybe I need root access. So, am I at a dead end? Or can you think of a workaround? Thanks for any insight. ________________________________ From: Eric Pettersen <pett@cgl.ucsf.edu> Sent: Tuesday, August 15, 2023 6:18 PM To: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu> Cc: BARRY E DEZONIA <barry.dezonia@wisc.edu> Subject: Re: [chimerax-users] Plugin development questions On Aug 15, 2023, at 4:11 PM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> wrote: the traj2nmr executable module is importable

Hi Barry, The problem is that ChimeraX is installed as root on Linux and that a simple “setup.py install” tries to install into the app, which it does not have permission for. You need to get it to install into a user-owned area that ChimeraX looks at for modules. That directory is contained in chimerax.app_dirs.user_data_dir. You get setup.py to install there with “setup.py install —home=value-from-app_dirs”. —Eric
On Aug 17, 2023, at 1:18 PM, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Thanks for the help Eric.
I am pretty close to everything working but I think this traj2nmr install approach might be a dead end.
In my chimerax tool I have this at the beginning:
if importlib.util.find_spec('traj2nmr') is None:
app_dir = pathlib.Path(__file__).parent.resolve()
subprocess.run(["python3", app_dir / 'Installable' / 'install_traj2nmr.py', sys.executable])
Then in my install_traj2nmr.py file that gets called by the above code I have this:
this_files_dir = pathlib.Path(__file__).parent.resolve()
chimerax = sys.argv[1]
os.system(f"cd {this_files_dir}/traj2nmr; {chimerax} --nogui --script 'setup.py install' --exit")
And it ALMOST works. Unfortunately it seems that I might need sudo access to run that command. This is the info Chimera gives back when it tries to run my code:
/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. dist.fetch_build_eggs(dist.setup_requires) running install /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the installation directory:
[Errno 13] Permission denied: '/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/test-easy-install-134656.write-test'
There is a paragraph of explanation saying maybe I need root access. So, am I at a dead end? Or can you think of a workaround? Thanks for any insight.
From: Eric Pettersen <pett@cgl.ucsf.edu <mailto:pett@cgl.ucsf.edu>> Sent: Tuesday, August 15, 2023 6:18 PM To: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> Cc: BARRY E DEZONIA <barry.dezonia@wisc.edu <mailto:barry.dezonia@wisc.edu>> Subject: Re: [chimerax-users] Plugin development questions
On Aug 15, 2023, at 4:11 PM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
the traj2nmr executable module is importable
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Another possibility, is that if you create the wheel first with "setup.py bdist_wheel", then "chimerax -m pip install --user NAME.whl" will install it in your personal extensions to ChimeraX. -- Greg On 8/17/2023 4:27 PM, Eric Pettersen via ChimeraX-users wrote:
Hi Barry, The problem is that ChimeraX is installed as root on Linux and that a simple “setup.py install” tries to install into the app, which it does not have permission for. You need to get it to install into a user-owned area that ChimeraX looks at for modules. That directory is contained in chimerax.app_dirs.user_data_dir. You get setup.py to install there with “setup.py install —home=/value-from-app_dirs/”.
—Eric
On Aug 17, 2023, at 1:18 PM, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Thanks for the help Eric.
I am pretty close to everything working but I think this traj2nmr install approach might be a dead end.
In my chimerax tool I have this at the beginning:
if importlib.util.find_spec('traj2nmr') is None: app_dir = pathlib.Path(__file__).parent.resolve()
subprocess.run(["python3", app_dir / 'Installable' / 'install_traj2nmr.py', sys.executable])
Then in my install_traj2nmr.py file that gets called by the above code I have this:
this_files_dir = pathlib.Path(__file__).parent.resolve()
chimerax = sys.argv[1]
os.system(f"cd {this_files_dir}/traj2nmr; {chimerax} --nogui --script 'setup.py install' --exit")
And it ALMOST works. Unfortunately it seems that I might need sudo access to run that command. This is the info Chimera gives back when it tries to run my code:
/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. dist.fetch_build_eggs(dist.setup_requires) running install /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the installation directory:
[Errno 13] Permission denied: '/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/test-easy-install-134656.write-test'
There is a paragraph of explanation saying maybe I need root access. So, am I at a dead end? Or can you think of a workaround? Thanks for any insight.
------------------------------------------------------------------------ *From:*Eric Pettersen <pett@cgl.ucsf.edu> *Sent:*Tuesday, August 15, 2023 6:18 PM *To:*ChimeraX Users Help <chimerax-users@cgl.ucsf.edu> *Cc:*BARRY E DEZONIA <barry.dezonia@wisc.edu> *Subject:*Re: [chimerax-users] Plugin development questions
On Aug 15, 2023, at 4:11 PM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
the traj2nmrexecutablemodule is importable
_______________________________________________ ChimeraX-users mailing list --chimerax-users@cgl.ucsf.edu To unsubscribe send an email tochimerax-users-leave@cgl.ucsf.edu Archives:https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
_______________________________________________ ChimeraX-users mailing list --chimerax-users@cgl.ucsf.edu To unsubscribe send an email tochimerax-users-leave@cgl.ucsf.edu Archives:https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

Thanks Eric. I have one issue. When I reference chimerax.app_dirs.user_data_dir in my tool ChimeraX complains that "chimerax" is undefined. Do you have a more correct way to find this path? Maybe you had a typo? Note that "ChimeraX" doesn't work either. ________________________________ From: Eric Pettersen <pett@cgl.ucsf.edu> Sent: Thursday, August 17, 2023 6:27 PM To: BARRY E DEZONIA <barry.dezonia@wisc.edu> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Plugin development questions Hi Barry, The problem is that ChimeraX is installed as root on Linux and that a simple “setup.py install” tries to install into the app, which it does not have permission for. You need to get it to install into a user-owned area that ChimeraX looks at for modules. That directory is contained in chimerax.app_dirs.user_data_dir. You get setup.py to install there with “setup.py install —home=value-from-app_dirs”. —Eric On Aug 17, 2023, at 1:18 PM, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote: Thanks for the help Eric. I am pretty close to everything working but I think this traj2nmr install approach might be a dead end. In my chimerax tool I have this at the beginning: if importlib.util.find_spec('traj2nmr') is None: app_dir = pathlib.Path(__file__).parent.resolve() subprocess.run(["python3", app_dir / 'Installable' / 'install_traj2nmr.py', sys.executable]) Then in my install_traj2nmr.py file that gets called by the above code I have this: this_files_dir = pathlib.Path(__file__).parent.resolve() chimerax = sys.argv[1] os.system(f"cd {this_files_dir}/traj2nmr; {chimerax} --nogui --script 'setup.py install' --exit") And it ALMOST works. Unfortunately it seems that I might need sudo access to run that command. This is the info Chimera gives back when it tries to run my code: /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. dist.fetch_build_eggs(dist.setup_requires) running install /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 13] Permission denied: '/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/test-easy-install-134656.write-test' There is a paragraph of explanation saying maybe I need root access. So, am I at a dead end? Or can you think of a workaround? Thanks for any insight. ________________________________ From: Eric Pettersen <pett@cgl.ucsf.edu<mailto:pett@cgl.ucsf.edu>> Sent: Tuesday, August 15, 2023 6:18 PM To: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> Cc: BARRY E DEZONIA <barry.dezonia@wisc.edu<mailto:barry.dezonia@wisc.edu>> Subject: Re: [chimerax-users] Plugin development questions On Aug 15, 2023, at 4:11 PM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> wrote: the traj2nmr executable module is importable _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu<mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/

You need to "import chimerax" first. --Eric
On Aug 18, 2023, at 10:25 AM, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:
Thanks Eric. I have one issue. When I reference chimerax.app_dirs.user_data_dir in my tool ChimeraX complains that "chimerax" is undefined. Do you have a more correct way to find this path? Maybe you had a typo? Note that "ChimeraX" doesn't work either. From: Eric Pettersen <pett@cgl.ucsf.edu <mailto:pett@cgl.ucsf.edu>> Sent: Thursday, August 17, 2023 6:27 PM To: BARRY E DEZONIA <barry.dezonia@wisc.edu <mailto:barry.dezonia@wisc.edu>> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> Subject: Re: [chimerax-users] Plugin development questions
Hi Barry, The problem is that ChimeraX is installed as root on Linux and that a simple “setup.py install” tries to install into the app, which it does not have permission for. You need to get it to install into a user-owned area that ChimeraX looks at for modules. That directory is contained in chimerax.app_dirs.user_data_dir. You get setup.py to install there with “setup.py install —home=value-from-app_dirs”.
—Eric
On Aug 17, 2023, at 1:18 PM, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
Thanks for the help Eric.
I am pretty close to everything working but I think this traj2nmr install approach might be a dead end.
In my chimerax tool I have this at the beginning:
if importlib.util.find_spec('traj2nmr') is None:
app_dir = pathlib.Path(__file__).parent.resolve()
subprocess.run(["python3", app_dir / 'Installable' / 'install_traj2nmr.py', sys.executable])
Then in my install_traj2nmr.py file that gets called by the above code I have this:
this_files_dir = pathlib.Path(__file__).parent.resolve()
chimerax = sys.argv[1]
os.system(f"cd {this_files_dir}/traj2nmr; {chimerax} --nogui --script 'setup.py install' --exit")
And it ALMOST works. Unfortunately it seems that I might need sudo access to run that command. This is the info Chimera gives back when it tries to run my code:
/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. dist.fetch_build_eggs(dist.setup_requires) running install /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the installation directory:
[Errno 13] Permission denied: '/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/test-easy-install-134656.write-test'
There is a paragraph of explanation saying maybe I need root access. So, am I at a dead end? Or can you think of a workaround? Thanks for any insight.
From: Eric Pettersen <pett@cgl.ucsf.edu <mailto:pett@cgl.ucsf.edu>> Sent: Tuesday, August 15, 2023 6:18 PM To: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> Cc: BARRY E DEZONIA <barry.dezonia@wisc.edu <mailto:barry.dezonia@wisc.edu>> Subject: Re: [chimerax-users] Plugin development questions
On Aug 15, 2023, at 4:11 PM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu>> wrote:
the traj2nmr executable module is importable
_______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/ <https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/>
ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu <mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu <mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/ <https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/>

That was the last bit. Everything is working. Thanks for all your help! ________________________________ From: Eric Pettersen <pett@cgl.ucsf.edu> Sent: Friday, August 18, 2023 12:35 PM To: BARRY E DEZONIA <barry.dezonia@wisc.edu> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu> Subject: Re: [chimerax-users] Plugin development questions You need to "import chimerax" first. --Eric On Aug 18, 2023, at 10:25 AM, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> wrote: Thanks Eric. I have one issue. When I reference chimerax.app_dirs.user_data_dir in my tool ChimeraX complains that "chimerax" is undefined. Do you have a more correct way to find this path? Maybe you had a typo? Note that "ChimeraX" doesn't work either. ________________________________ From: Eric Pettersen <pett@cgl.ucsf.edu<mailto:pett@cgl.ucsf.edu>> Sent: Thursday, August 17, 2023 6:27 PM To: BARRY E DEZONIA <barry.dezonia@wisc.edu<mailto:barry.dezonia@wisc.edu>> Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> Subject: Re: [chimerax-users] Plugin development questions Hi Barry, The problem is that ChimeraX is installed as root on Linux and that a simple “setup.py install” tries to install into the app, which it does not have permission for. You need to get it to install into a user-owned area that ChimeraX looks at for modules. That directory is contained in chimerax.app_dirs.user_data_dir. You get setup.py to install there with “setup.py install —home=value-from-app_dirs”. —Eric On Aug 17, 2023, at 1:18 PM, BARRY E DEZONIA via ChimeraX-users <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> wrote: Thanks for the help Eric. I am pretty close to everything working but I think this traj2nmr install approach might be a dead end. In my chimerax tool I have this at the beginning: if importlib.util.find_spec('traj2nmr') is None: app_dir = pathlib.Path(__file__).parent.resolve() subprocess.run(["python3", app_dir / 'Installable' / 'install_traj2nmr.py', sys.executable]) Then in my install_traj2nmr.py file that gets called by the above code I have this: this_files_dir = pathlib.Path(__file__).parent.resolve() chimerax = sys.argv[1] os.system(f"cd {this_files_dir}/traj2nmr; {chimerax} --nogui --script 'setup.py install' --exit") And it ALMOST works. Unfortunately it seems that I might need sudo access to run that command. This is the info Chimera gives back when it tries to run my code: /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/__init__.py:85: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated. Requirements should be satisfied by a PEP 517 installer. If you are using pip, you can try `pip install --use-pep517`. dist.fetch_build_eggs(dist.setup_requires) running install /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. warnings.warn( /usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/setuptools/command/easy_install.py:144: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. warnings.warn( error: can't create or remove files in install directory The following error occurred while trying to add or remove files in the installation directory: [Errno 13] Permission denied: '/usr/lib/ucsf-chimerax-daily/lib/python3.9/site-packages/test-easy-install-134656.write-test' There is a paragraph of explanation saying maybe I need root access. So, am I at a dead end? Or can you think of a workaround? Thanks for any insight. ________________________________ From: Eric Pettersen <pett@cgl.ucsf.edu<mailto:pett@cgl.ucsf.edu>> Sent: Tuesday, August 15, 2023 6:18 PM To: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> Cc: BARRY E DEZONIA <barry.dezonia@wisc.edu<mailto:barry.dezonia@wisc.edu>> Subject: Re: [chimerax-users] Plugin development questions On Aug 15, 2023, at 4:11 PM, Eric Pettersen via ChimeraX-users <chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu>> wrote: the traj2nmr executable module is importable _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu<mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/ _______________________________________________ ChimeraX-users mailing list -- chimerax-users@cgl.ucsf.edu<mailto:chimerax-users@cgl.ucsf.edu> To unsubscribe send an email to chimerax-users-leave@cgl.ucsf.edu<mailto:chimerax-users-leave@cgl.ucsf.edu> Archives: https://mail.cgl.ucsf.edu/mailman/archives/list/chimerax-users@cgl.ucsf.edu/
participants (4)
-
BARRY E DEZONIA
-
Eric Pettersen
-
Greg Couch
-
Tony Schaefer