Thanks Eric, it's working now!

Best Regards,
Katie

From: Eric Pettersen <pett@cgl.ucsf.edu>
Sent: 30 March 2022 21:32
To: Zeng, Katie <jingrou.zeng18@imperial.ac.uk>
Cc: ChimeraX Users Help <chimerax-users@cgl.ucsf.edu>
Subject: Re: [chimerax-users] Bundle Module Import
 

This email from pett@cgl.ucsf.edu originates from outside Imperial. Do not click on links and attachments unless you recognise the sender. If you trust the sender, add them to your safe senders list to disable email stamping for this address.

 

Hi Katie,
I'm not 100% an expert on the vagaries of the Python import mechanism, but here are a few thing to check/try:

1) Make sure your ui subfolder has an __init__.py file in it.
2) Try importing the package first, i.e.:

import AmberLipidBundle.ui
from AmberLipidBundle.ui.lipid_form import xxx

3) Use a relative import rather than an absolute import, i.e.:

from .ui.lipid_form import xxx

I've got my fingers crossed that one of those does the trick. :-)

--Eric

Eric Pettersen
UCSF Computer Graphics Lab


On Mar 30, 2022, at 9:31 AM, Zeng, Katie via ChimeraX-users <chimerax-users@cgl.ucsf.edu> wrote:

Hi all,

I am currently working on a membrane builder bundle called AmberLipidBundle. I have folder './src/ui' (containing several .py files, e.g. lipid_form.py) and I import it inside .py files with the line 'from AmberLipidBundle.ui.lipid_form import xxx'.

I have been testing the bundle using the command 'devel build [path]' and everything works fine. But when I switch to the command 'devel install [path]', I get an error: 

chimerax.core.toolshed.ToolshedError: start_tool() failed for tool Membrane Builder in bundle AmberLipidBundle:
No module named 'AmberLipidBundle.ui'

Do you have any idea how to fix this? Thank you so much for your help!

Best Regards,
Katie
_______________________________________________
ChimeraX-users mailing list
ChimeraX-users@cgl.ucsf.edu
Manage subscription:
https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users