<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>Looking at your bundle_info.xml, I would recommend naming your command something other than "CL_Tensorflow". That will be awfully hard to type (even given that you can shorten the name when actually typing it). I would recommend something that doesn't require using the Shift key to type. Also, I would declare the Core dependency to be on 1.0 rather than 1.0rc.<div class=""><span class="Apple-tab-span" style="white-space:pre"> </span>As for the __init__.py, it looks like you are registering the command twice. Depending on how register_command is declared in cmd.py, that could be causing the error. Try removing the "cmd.register_command(CL_Tensorflow, logger)" line. Then the only registration will be the one at the end ("register(CL_Tensorflow, desc, cmd.CL_Tensorflow)").</div><div class=""><br class=""></div><div class="">--Eric</div><div class=""><br class=""><div class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Feb 4, 2021, at 2:51 PM, 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="">Hi Eric,<div class=""><br class=""></div><div class="">I really appreciate your quick response. It really helps me a lot to understand it. But I have another question, following your instructions, I modified the _init_.py file but it still holds an error. I attached some related information below.</div><div class=""><br class=""></div><div class="">Thank you for your time and help.</div><div class=""><br class=""></div><div class="">Best regards,</div><div class="">Yongcheng</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 4, 2021 at 4:09 PM Eric Pettersen <<a href="mailto:pett@cgl.ucsf.edu" class="">pett@cgl.ucsf.edu</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">Hi Yongcheng,<div class=""><span style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </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 style="white-space:pre-wrap" class=""> </span>Eric Pettersen</div><div class=""><span style="white-space:pre-wrap" class=""> </span>UCSF Computer Graphics Lab</div></div><div class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Feb 4, 2021, at 10:45 AM, Yongcheng MU <<a href="mailto:ymu004@odu.edu" target="_blank" class="">ymu004@odu.edu</a>> wrote:</div><br class=""><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" 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" target="_blank" class="">ChimeraX-users@cgl.ucsf.edu</a><br class="">Manage subscription:<br class=""><a href="https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users" target="_blank" class="">https://www.rbvi.ucsf.edu/mailman/listinfo/chimerax-users</a><br class=""></div></blockquote></div><br class=""></div></div></blockquote></div>
<span id="cid:f_kkrgb8a70"><bundle_info.xml></span><span id="cid:f_kkrgbh861"><__init__.py></span><span id="cid:f_kkrgcd6e2"><Screen Shot 2021-02-04 at 5.41.25 PM.png></span><span id="cid:f_kkrgcd6f3"><Screen Shot 2021-02-04 at 5.42.02 PM.png></span>_______________________________________________<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></div></body></html>