MouseLand/cellpose-napari

cellpose-napari on an offline workstation

haesleinhuepf opened this issue · 1 comments

Hi all,

I'm just installing napari on an offline-workstation. Those machines unfortunately exist quite a lot in local light microscopy facilities. Napari works well if I copy the installation directory with all installed plugins on the other computer. However, cellpose doesn't show up in the napari menu. Under Plugins > Plugin Errors... it says "No connection could be made because the target machine refused it." (full error log below). Is there any way to run cellpose-napari on an offline machine?

Thanks!

Best,
Robert

======================= Errors for plugin 'cellpose-napari' =======================

  napari version: 0.4.10


ERROR #1:  Error while importing module cellpose_napari --------------------------

�[1;31m---------------------------------------------------------------------------�[0m
�[1;31mConnectionRefusedError�[0m                    Traceback (most recent call last)
�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\urllib\request.pyc�[0m in �[0;36mdo_open�[1;34m(self=<urllib.request.HTTPSHandler object>, http_class=<class 'http.client.HTTPSConnection'>, req=<urllib.request.Request object>, **http_conn_args={'check_hostname': None, 'context': None})�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\http\client.pyc�[0m in �[0;36mrequest�[1;34m(self=<http.client.HTTPSConnection object>, method='GET', url='/models/cyto_0', body=None, headers={'Connection': 'close', 'Host': 'www.cellpose.org', 'User-Agent': 'Python-urllib/3.8'}, encode_chunked=False)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\http\client.pyc�[0m in �[0;36m_send_request�[1;34m(self=<http.client.HTTPSConnection object>, method='GET', url='/models/cyto_0', body=None, headers={'Connection': 'close', 'Host': 'www.cellpose.org', 'User-Agent': 'Python-urllib/3.8'}, encode_chunked=False)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\http\client.pyc�[0m in �[0;36mendheaders�[1;34m(self=<http.client.HTTPSConnection object>, message_body=None, encode_chunked=False)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\http\client.pyc�[0m in �[0;36m_send_output�[1;34m(self=<http.client.HTTPSConnection object>, message_body=None, encode_chunked=False)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\http\client.pyc�[0m in �[0;36msend�[1;34m(self=<http.client.HTTPSConnection object>, data=b'GET /models/cyto_0 HTTP/1.1\r\nAccept-Encoding...: Python-urllib/3.8\r\nConnection: close\r\n\r\n')�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\http\client.pyc�[0m in �[0;36mconnect�[1;34m(self=<http.client.HTTPSConnection object>)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\http\client.pyc�[0m in �[0;36mconnect�[1;34m(self=<http.client.HTTPSConnection object>)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\socket.pyc�[0m in �[0;36mcreate_connection�[1;34m(address=('www.cellpose.org', 443), timeout=<object object>, source_address=None)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\socket.pyc�[0m in �[0;36mcreate_connection�[1;34m(address=('www.cellpose.org', 443), timeout=<object object>, source_address=None)�[0m

�[1;31mConnectionRefusedError�[0m: [WinError 10061] No connection could be made because the target machine actively refused it

During handling of the above exception, another exception occurred:

�[1;31mURLError�[0m                                  Traceback (most recent call last)
�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\\app_packages\napari_plugin_engine\manager.py�[0m in �[0;36m_load_and_register�[1;34m(self=<napari.plugins._plugin_manager.NapariPluginManager object>, mod_name='cellpose_napari', plugin_name='cellpose-napari')�[0m
�[0;32m    291�[0m         �[1;32mtry�[0m�[1;33m:�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[1;32m--> 292�[1;33m             �[0mmodule�[0m �[1;33m=�[0m �[0mload�[0m�[1;33m(�[0m�[0mmod_name�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0m        �[0;36mmodule�[0m �[1;34m= �[1;36mundefined�[0m�[0m�[1;34m
        �[0m�[1;36mglobal�[0m �[0;36mload�[0m �[1;34m= <function load at 0x00000192F7644A60>�[0m�[1;34m
        �[0m�[0;36mmod_name�[0m �[1;34m= 'cellpose_napari'�[0m
�[0;32m    293�[0m             �[1;32mif�[0m �[0mself�[0m�[1;33m.�[0m�[0mis_registered�[0m�[1;33m(�[0m�[0mmodule�[0m�[1;33m)�[0m�[1;33m:�[0m�[1;33m�[0m�[1;33m�[0m�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\\app_packages\napari_plugin_engine\manager.py�[0m in �[0;36mload�[1;34m(value='cellpose_napari')�[0m
�[0;32m   1004�[0m         �[1;32mraise�[0m �[0mValueError�[0m�[1;33m(�[0m�[1;34mf"malformed entry point string: {value}"�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[1;32m-> 1005�[1;33m     �[0mmodule�[0m �[1;33m=�[0m �[0mimportlib�[0m�[1;33m.�[0m�[0mimport_module�[0m�[1;33m(�[0m�[0mmatch�[0m�[1;33m.�[0m�[0mgroup�[0m�[1;33m(�[0m�[1;34m'module'�[0m�[1;33m)�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0m        �[0;36mmodule�[0m �[1;34m= �[1;36mundefined�[0m�[0m�[1;34m
        �[0m�[1;36mglobal�[0m �[0;36mimportlib.import_module�[0m �[1;34m= <function import_module at 0x0000019202F71310>�[0m�[1;34m
        �[0m�[0;36mmatch.group�[0m �[1;34m= <built-in method group of re.Match object at 0x00000193053D90E0>�[0m
�[0;32m   1006�[0m     �[0mattrs�[0m �[1;33m=�[0m �[0mfilter�[0m�[1;33m(�[0m�[1;32mNone�[0m�[1;33m,�[0m �[1;33m(�[0m�[0mmatch�[0m�[1;33m.�[0m�[0mgroup�[0m�[1;33m(�[0m�[1;34m'attr'�[0m�[1;33m)�[0m �[1;32mor�[0m �[1;34m''�[0m�[1;33m)�[0m�[1;33m.�[0m�[0msplit�[0m�[1;33m(�[0m�[1;34m'.'�[0m�[1;33m)�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\importlib\__init__.pyc�[0m in �[0;36mimport_module�[1;34m(name='cellpose_napari', package=None)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\importlib\_bootstrap.pyc�[0m in �[0;36m_gcd_import�[1;34m(name='cellpose_napari', package=None, level=0)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\importlib\_bootstrap.pyc�[0m in �[0;36m_find_and_load�[1;34m(name='cellpose_napari', import_=<function _gcd_import>)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\importlib\_bootstrap.pyc�[0m in �[0;36m_find_and_load_unlocked�[1;34m(name='cellpose_napari', import_=<function _gcd_import>)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\importlib\_bootstrap.pyc�[0m in �[0;36m_load_unlocked�[1;34m(spec=ModuleSpec(name='cellpose_napari', loader=<_froz...ython\\\\Lib\\\\site-packages\\cellpose_napari']))�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\importlib\_bootstrap_external.pyc�[0m in �[0;36mexec_module�[1;34m(self=<_frozen_importlib_external.SourceFileLoader object>, module=<module 'cellpose_napari' from 'D:\\install\\ByR...\\\\site-packages\\cellpose_napari\\__init__.py'>)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\importlib\_bootstrap.pyc�[0m in �[0;36m_call_with_frames_removed�[1;34m(f=<built-in function exec>, *args=(<code object <module> at 0x00000193053D9DF0, fil...te-packages\cellpose_napari\__init__.py", line 1>, {'__builtins__': {'ArithmeticError': <class 'ArithmeticError'>, 'AssertionError': <class 'AssertionError'>, 'AttributeError': <class 'AttributeError'>, 'BaseException': <class 'BaseException'>, 'BlockingIOError': <class 'BlockingIOError'>, 'BrokenPipeError': <class 'BrokenPipeError'>, 'BufferError': <class 'BufferError'>, 'BytesWarning': <class 'BytesWarning'>, 'ChildProcessError': <class 'ChildProcessError'>, 'ConnectionAbortedError': <class 'ConnectionAbortedError'>, ...}, '__cached__': r'D:\install\ByRobertHaase\napari_20210802\napari\...llpose_napari\__pycache__\__init__.cpython-38.pyc', '__doc__': None, '__file__': r'D:\install\ByRobertHaase\napari_20210802\napari\...n\\Lib\\site-packages\cellpose_napari\__init__.py', '__loader__': <_frozen_importlib_external.SourceFileLoader object>, '__name__': 'cellpose_napari', '__package__': 'cellpose_napari', '__path__': [r'D:\install\ByRobertHaase\napari_20210802\napari\python\\Lib\\site-packages\cellpose_napari'], '__spec__': ModuleSpec(name='cellpose_napari', loader=<_froz...ython\\\\Lib\\\\site-packages\\cellpose_napari']), '__version__': 'unknown'}), **kwds={})�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\\Lib\\site-packages\cellpose_napari\__init__.py�[0m in �[0;36m<module>�[1;34m�[0m
�[0;32m      5�[0m �[1;33m�[0m�[0m
�[1;32m----> 6�[1;33m �[1;32mfrom�[0m �[1;33m.�[0m�[0m_dock_widget�[0m �[1;32mimport�[0m �[0mnapari_experimental_provide_dock_widget�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0m        �[1;36mglobal�[0m �[0;36m_dock_widget�[0m �[1;34m= �[1;36mundefined�[0m�[0m�[1;34m
        �[0m�[1;36mglobal�[0m �[0;36mnapari_experimental_provide_dock_widget�[0m �[1;34m= �[1;36mundefined�[0m�[0m
�[0;32m      7�[0m �[1;32mfrom�[0m �[1;33m.�[0m�[0m_sample_data�[0m �[1;32mimport�[0m �[0mnapari_provide_sample_data�[0m�[1;33m�[0m�[1;33m�[0m�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\\Lib\\site-packages\cellpose_napari\_dock_widget.py�[0m in �[0;36m<module>�[1;34m�[0m
�[0;32m     18�[0m �[1;33m�[0m�[0m
�[1;32m---> 19�[1;33m �[1;32mfrom�[0m �[0mcellpose�[0m �[1;32mimport�[0m �[0mmodels�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0m        �[1;36mglobal�[0m �[0;36mcellpose�[0m �[1;34m= �[1;36mundefined�[0m�[0m�[1;34m
        �[0m�[1;36mglobal�[0m �[0;36mmodels�[0m �[1;34m= �[1;36mundefined�[0m�[0m
�[0;32m     20�[0m �[1;32mfrom�[0m �[0mcellpose�[0m�[1;33m.�[0m�[0mutils�[0m �[1;32mimport�[0m �[0mmasks_to_outlines�[0m�[1;33m,�[0m �[0mfill_holes_and_remove_small_masks�[0m�[1;33m�[0m�[1;33m�[0m�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\\Lib\\site-packages\cellpose\models.py�[0m in �[0;36m<module>�[1;34m�[0m
�[0;32m     57�[0m �[1;33m�[0m�[0m
�[1;32m---> 58�[1;33m �[0mdownload_model_weights�[0m�[1;33m(�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0m        �[1;36mglobal�[0m �[0;36mdownload_model_weights�[0m �[1;34m= <function download_model_weights at 0x00000193053CFC10>�[0m
�[0;32m     59�[0m �[0mmodel_dir�[0m �[1;33m=�[0m �[0mpathlib�[0m�[1;33m.�[0m�[0mPath�[0m�[1;33m.�[0m�[0mhome�[0m�[1;33m(�[0m�[1;33m)�[0m�[1;33m.�[0m�[0mjoinpath�[0m�[1;33m(�[0m�[1;34m'.cellpose'�[0m�[1;33m,�[0m �[1;34m'models'�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\\Lib\\site-packages\cellpose\models.py�[0m in �[0;36mdownload_model_weights�[1;34m(urls=['https://www.cellpose.org/models/cyto_0', 'https://www.cellpose.org/models/cyto_1', 'https://www.cellpose.org/models/cyto_2', 'https://www.cellpose.org/models/cyto_3', 'https://www.cellpose.org/models/size_cyto_0.npy', 'https://www.cellpose.org/models/cytotorch_0', 'https://www.cellpose.org/models/cytotorch_1', 'https://www.cellpose.org/models/cytotorch_2', 'https://www.cellpose.org/models/cytotorch_3', 'https://www.cellpose.org/models/size_cytotorch_0.npy', 'https://www.cellpose.org/models/cyto2torch_0', 'https://www.cellpose.org/models/cyto2torch_1', 'https://www.cellpose.org/models/cyto2torch_2', 'https://www.cellpose.org/models/cyto2torch_3', 'https://www.cellpose.org/models/size_cyto2torch_0.npy', 'https://www.cellpose.org/models/nuclei_0', 'https://www.cellpose.org/models/nuclei_1', 'https://www.cellpose.org/models/nuclei_2', 'https://www.cellpose.org/models/nuclei_3', 'https://www.cellpose.org/models/size_nuclei_0.npy', ...])�[0m
�[0;32m     55�[0m             �[0mmodels_logger�[0m�[1;33m.�[0m�[0minfo�[0m�[1;33m(�[0m�[1;34m'Downloading: "{}" to {}\n'�[0m�[1;33m.�[0m�[0mformat�[0m�[1;33m(�[0m�[0murl�[0m�[1;33m,�[0m �[0mcached_file�[0m�[1;33m)�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[1;32m---> 56�[1;33m             �[0mutils�[0m�[1;33m.�[0m�[0mdownload_url_to_file�[0m�[1;33m(�[0m�[0murl�[0m�[1;33m,�[0m �[0mcached_file�[0m�[1;33m,�[0m �[0mprogress�[0m�[1;33m=�[0m�[1;32mTrue�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0m        �[1;36mglobal�[0m �[0;36mutils.download_url_to_file�[0m �[1;34m= <function download_url_to_file at 0x000001930C736310>�[0m�[1;34m
        �[0m�[0;36murl�[0m �[1;34m= 'https://www.cellpose.org/models/cyto_0'�[0m�[1;34m
        �[0m�[0;36mcached_file�[0m �[1;34m= 'C:\\Users\\lmf-user\\.cellpose\\models\\cyto_0'�[0m�[1;34m
        �[0m�[1;36mglobal�[0m �[0;36mprogress�[0m �[1;34m= �[1;36mundefined�[0m�[0m
�[0;32m     57�[0m �[1;33m�[0m�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\\Lib\\site-packages\cellpose\utils.py�[0m in �[0;36mdownload_url_to_file�[1;34m(url='https://www.cellpose.org/models/cyto_0', dst=r'C:\Users\lmf-user\.cellpose\models\cyto_0', progress=True)�[0m
�[0;32m     54�[0m     �[0mfile_size�[0m �[1;33m=�[0m �[1;32mNone�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[1;32m---> 55�[1;33m     �[0mu�[0m �[1;33m=�[0m �[0murlopen�[0m�[1;33m(�[0m�[0murl�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0m        �[0;36mu�[0m �[1;34m= �[1;36mundefined�[0m�[0m�[1;34m
        �[0m�[1;36mglobal�[0m �[0;36murlopen�[0m �[1;34m= <function urlopen at 0x00000192F80C6A60>�[0m�[1;34m
        �[0m�[0;36murl�[0m �[1;34m= 'https://www.cellpose.org/models/cyto_0'�[0m
�[0;32m     56�[0m     �[0mmeta�[0m �[1;33m=�[0m �[0mu�[0m�[1;33m.�[0m�[0minfo�[0m�[1;33m(�[0m�[1;33m)�[0m�[1;33m�[0m�[1;33m�[0m�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\urllib\request.pyc�[0m in �[0;36murlopen�[1;34m(url='https://www.cellpose.org/models/cyto_0', data=None, timeout=<object object>, cafile=None, capath=None, cadefault=False, context=None)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\urllib\request.pyc�[0m in �[0;36mopen�[1;34m(self=<urllib.request.OpenerDirector object>, fullurl='https://www.cellpose.org/models/cyto_0', data=None, timeout=<object object>)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\urllib\request.pyc�[0m in �[0;36m_open�[1;34m(self=<urllib.request.OpenerDirector object>, req=<urllib.request.Request object>, data=None)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\urllib\request.pyc�[0m in �[0;36m_call_chain�[1;34m(self=<urllib.request.OpenerDirector object>, chain={'data': [<urllib.request.DataHandler object>], 'file': [<urllib.request.FileHandler object>], 'ftp': [<urllib.request.FTPHandler object>], 'http': [<urllib.request.HTTPHandler object>], 'https': [<urllib.request.HTTPSHandler object>], 'unknown': [<urllib.request.UnknownHandler object>]}, kind='https', meth_name='https_open', *args=(<urllib.request.Request object>,))�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\urllib\request.pyc�[0m in �[0;36mhttps_open�[1;34m(self=<urllib.request.HTTPSHandler object>, req=<urllib.request.Request object>)�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\python\python38.zip\urllib\request.pyc�[0m in �[0;36mdo_open�[1;34m(self=<urllib.request.HTTPSHandler object>, http_class=<class 'http.client.HTTPSConnection'>, req=<urllib.request.Request object>, **http_conn_args={'check_hostname': None, 'context': None})�[0m

�[1;31mURLError�[0m: <urlopen error [WinError 10061] No connection could be made because the target machine actively refused it>

The above exception was the direct cause of the following exception:

�[1;31mPluginImportError�[0m                         Traceback (most recent call last)
�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\\app_packages\napari_plugin_engine\manager.py�[0m in �[0;36mdiscover�[1;34m(self=<napari.plugins._plugin_manager.NapariPluginManager object>, path=None, entry_point=None, prefix=None, ignore_errors=True)�[0m
�[0;32m    241�[0m �[1;33m�[0m�[0m
�[0;32m    242�[0m             �[1;32mtry�[0m�[1;33m:�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[1;32m--> 243�[1;33m                 �[1;32mif�[0m �[0mself�[0m�[1;33m.�[0m�[0m_load_and_register�[0m�[1;33m(�[0m�[0mmod_name�[0m�[1;33m,�[0m �[0mname�[0m�[1;33m)�[0m�[1;33m:�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0m        �[0;36mself._load_and_register�[0m �[1;34m= <bound method PluginManager._load_and_register of <napari.plugins._plugin_manager.NapariPluginManager object at 0x00000192F7A5F040>>�[0m�[1;34m
        �[0m�[0;36mmod_name�[0m �[1;34m= 'stardist_napari'�[0m�[1;34m
        �[0m�[0;36mname�[0m �[1;34m= 'StarDist'�[0m
�[0;32m    244�[0m                     �[0mcount�[0m �[1;33m+=�[0m �[1;36m1�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0;32m    245�[0m             �[1;32mexcept�[0m �[0mPluginError�[0m �[1;32mas�[0m �[0me�[0m�[1;33m:�[0m�[1;33m�[0m�[1;33m�[0m�[0m

�[1;32mD:\install\ByRobertHaase\napari_20210802\napari\\app_packages\napari_plugin_engine\manager.py�[0m in �[0;36m_load_and_register�[1;34m(self=<napari.plugins._plugin_manager.NapariPluginManager object>, mod_name='cellpose_napari', plugin_name='cellpose-napari')�[0m
�[0;32m    294�[0m                 �[1;32mreturn�[0m �[1;32mNone�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0;32m    295�[0m         �[1;32mexcept�[0m �[0mException�[0m �[1;32mas�[0m �[0mexc�[0m�[1;33m:�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[1;32m--> 296�[1;33m             raise PluginImportError(
�[0m        �[1;36mglobal�[0m �[0;36mPluginImportError�[0m �[1;34m= <class 'napari_plugin_engine.exceptions.PluginImportError'>�[0m�[1;34m
        �[0m�[0;36mplugin_name�[0m �[1;34m= 'cellpose-napari'�[0m�[1;34m
        �[0m�[1;36mglobal�[0m �[0;36mcause�[0m �[1;34m= �[1;36mundefined�[0m�[0m�[1;34m
        �[0m�[0;36mexc�[0m �[1;34m= �[1;36mundefined�[0m�[0m
�[0;32m    297�[0m                 �[1;34mf'Error while importing module {mod_name}'�[0m�[1;33m,�[0m�[1;33m�[0m�[1;33m�[0m�[0m
�[0;32m    298�[0m                 �[0mplugin_name�[0m�[1;33m=�[0m�[0mplugin_name�[0m�[1;33m,�[0m�[1;33m�[0m�[1;33m�[0m�[0m

�[1;31mPluginImportError�[0m: Error while importing module cellpose_napari
================================================================================

Alright, I fixed it myself by copying over the "C:\Users<username>.cellpose" folder from another machine.

Thanks for reading :-)