Opened 2 years ago

Last modified 2 years ago

#10027 assigned task

Installing a python module at plugin start/load — at Version 1

Reported by: barry.dezonia@… Owned by: Zach Pearson
Priority: normal Milestone:
Component: Third Party Version:
Keywords: Cc: Greg Couch, Tom Goddard, Eric Pettersen
Blocked By: Blocking:
Notify when closed: Platform: all
Project: ChimeraX

Description (last modified by Tom Goddard)

This might not be a bug but it is definitely an email for the developers.

I am trying to build a plugin with a nice user experience. One aspect of that is that it will look for a plugin (traj2nmr) and if it is not installed it will install it. This was siggested by one of the developers some onths ago.

My process is kind of working. I am using a daily build (from June that I am loathe to update since all other aspects of our project works with it and I am the sole developer).

Anyhow my code installs the plugin and it ends up in /home/bdezonia/.local/share/ChimeraX/1.7/lib/python/traj2nmr-0.0.1-py3.9.egg.

Now when I start my app it can't import traj2nmr even after it just successfully installed. Python must not be looking in that directory above.

Someone told me to install tra2nmr in the chimerax.apps.user_dir. Maybe that is /home/bdezonia/.local/share/ChimeraX/1.7/site-packages/? Anyhow traj2nmr is not in there. And I'm not sure I am accurate about the value of chimerax.apps.user_dir I just mentioned.

It is not here either: /lib/ucsf-chimerax-daily/lib/python3.9. (Yes, I know 3.11 is the version expected but it was not back in June I think). We can't install here because the app installs traj2nmr at plugin startup and needs a directory the current user has permissions to write to.

Can you tell me where my traj2nmr package should get installed to so that it can be found by ChimeraX (e.g. its python I think)? The traj2nmr module is old and uses easyinstall and a "python setup.py install" approach. I don't have a lot of control where traj2nmr gets installed once it is running.

Any pointers appreciated. Let me know what other info you might need to help come up with a solution. Thanks.

Change History (1)

comment:1 by Tom Goddard, 2 years ago

Cc: Greg Couch Tom Goddard Eric Pettersen added
Component: UnassignedThird Party
Description: modified (diff)
Owner: set to Zach Pearson
Platform: all
Project: ChimeraX
Status: newassigned
Type: defecttask

Hi Barry,

Could you tell us the command you used to install traj2nmr. If you used the ChimeraX "pip install" there have been changes to make that install in the correct location after June. While you may not want to update your ChimeraX, if you are trying for "good user experience" that probably means it needs to work in current ChimeraX versions and the soon to be released ChimeraX 1.7, not just one old version from June. So I would suggest trying your plugin with the current daily build.

To debug why you cannot import traj2nmr how about starting the ChimeraX Python shell, menu Tools / General / Shell and see what the Python search path is

import sys
sys.path

Zach can give more advice.

Tom

Note: See TracTickets for help on using tickets.