<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Yongcheng,<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>You probably know this, but in order to avoid registering all commands at startup, which would involve executing the code from dozens of bundles and make startup really slow, ChimeraX uses information from the Toolshed to know which bundles implement which commands and only when the time comes to actually execute a command does it invoke the bundle's code that fully registers the command, which then allows ChimeraX to know what arguments and keywords the command allows and what function the command executes so that it can parse the command text and call that function.</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>So all that error text you got is indicating that there is an error in your command-registration function. ChimeraX asks you to register your command by calling the register_command() method of your BundleAPI subclass. Does the implementation of register_command() in your __init__.py look something like this?:</div><div class=""><br class=""></div><div class="">from chimerax.core.toolshed import BundleAPI<br class=""><br class="">class CL_TensorFlowAPI(BundleAPI):<br class=""><br class=""> @staticmethod<br class=""> def register_command(command_name, logger):<br class=""> from . import cmd<br class=""> cmd.register_command(command_name, logger)<br class=""><br class="">If it does, then the problem is that you have no cmd.py file in your bundle, producing the error:</div><div class=""><br class=""></div><div class="">cannot import name 'cmd' from 'chimerax.CL_Tensorflow' (/Users/jackmu/Library/Application Support/ChimeraX/1.1/site-packages/chimerax/CL_Tensorflow/__init__.py))</div><div class=""><br class=""></div><div class="">Let me know if you need further clarification.</div><div class=""><br class=""></div><div class=""><div class="">--Eric</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>Eric Pettersen</div><div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>UCSF Computer Graphics Lab</div></div><div class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Feb 4, 2021, at 10:45 AM, Yongcheng MU <<a href="mailto:ymu004@odu.edu" class="">ymu004@odu.edu</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello,<div class=""><br class=""></div><div class="">Hope you are doing well. This is Yongcheng. I am writing this email because I am trying to install a Deep learning tool in ChimeraX, but I have some issues about it.</div><div class=""><br class=""></div><div class="">I built and installed my code following the steps on the Chimera Guide website. I installed my code successfully, but when I run using command that I created, it hold some errors:</div><div class=""><br class=""></div><div class=""><font face="times new roman, serif" style="" class=""><i class="">"<span style="white-space:pre-wrap" class="">RuntimeError: delayed command registration for 'CL_Tensorflow' failed (register_command() failed for command CL_Tensorflow in bundle ChimeraX-CL-Tensorflow:</span></i></font></div><div style="margin: 0px; white-space: pre-wrap;" class=""><font face="times new roman, serif" class=""><i class="">cannot import name 'cmd' from 'chimerax.CL_Tensorflow' (/Users/jackmu/Library/Application Support/ChimeraX/1.1/site-packages/chimerax/CL_Tensorflow/__init__.py))<br class=""><br class="">File "/Users/jackmu/Desktop/ChimeraX-1.1.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/cli.py", line 2142, in lazy_register<br class=""></i></font></div><div class=""><font face="times new roman, serif" class=""><i class=""><span style="white-space:pre-wrap" class="">raise RuntimeError("delayed command registration for %r failed (%s)" % (cmd_name, e))</span>"</i></font></div><div class=""><font face="times new roman, serif" class=""><i class=""><br class=""></i></font></div><div class=""><font face="times new roman, serif" class=""><i class="">"During handling of the above exception, another exception occurred:</i></font></div><font face="times new roman, serif" class=""><i class=""><br class="">Traceback (most recent call last):<br class=""> File "/Users/jackmu/Desktop/ChimeraX-1.1.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/cmd_line/tool.py", line 275, in execute<br class=""> cmd.run(cmd_text)<br class=""> File "/Users/jackmu/Desktop/ChimeraX-1.1.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/cli.py", line 2746, in run<br class=""> self._find_command_name(final, used_aliases=_used_aliases)<br class=""> File "/Users/jackmu/Desktop/ChimeraX-1.1.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/cli.py", line 2489, in _find_command_name<br class=""> what.lazy_register(cmd_name)<br class=""> File "/Users/jackmu/Desktop/ChimeraX-1.1.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/cli.py", line 2142, in lazy_register<br class=""> raise RuntimeError("delayed command registration for %r failed (%s)" % (cmd_name, e))<br class="">RuntimeError: delayed command registration for 'CL_Tensorflow' failed (register_command() failed for command CL_Tensorflow in bundle ChimeraX-CL-Tensorflow:<br class="">cannot import name 'cmd' from 'chimerax.CL_Tensorflow' (/Users/jackmu/Library/Application Support/ChimeraX/1.1/site-packages/chimerax/CL_Tensorflow/__init__.py))<br class=""><br class="">RuntimeError: delayed command registration for 'CL_Tensorflow' failed (register_command() failed for command CL_Tensorflow in bundle ChimeraX-CL-Tensorflow:<br class="">cannot import name 'cmd' from 'chimerax.CL_Tensorflow' (/Users/jackmu/Library/Application Support/ChimeraX/1.1/site-packages/chimerax/CL_Tensorflow/__init__.py))<br class=""><br class="">File "/Users/jackmu/Desktop/ChimeraX-1.1.1.app/Contents/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/chimerax/core/commands/cli.py", line 2142, in lazy_register<br class=""></i></font><div class=""><font face="times new roman, serif" class=""><i class="">raise RuntimeError("delayed command registration for %r failed (%s)" % (cmd_name, e))"</i></font></div><div class=""><br class=""></div><div class="">I wonder if you know what's going on here, and how to fix it. Thank you so much for your time. </div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Yongcheng</div></div>
_______________________________________________<br class="">ChimeraX-users mailing list<br class=""><a href="mailto:ChimeraX-users@cgl.ucsf.edu" class="">ChimeraX-users@cgl.ucsf.edu</a><br class="">Manage subscription:<br class="">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users<br class=""></div></blockquote></div><br class=""></div></body></html>