Skip to content

Instantly share code, notes, and snippets.

@GenevieveBuckley
Created February 27, 2023 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GenevieveBuckley/e2eff6f4dfa7fad919bb27b4fe7ca07a to your computer and use it in GitHub Desktop.
Save GenevieveBuckley/e2eff6f4dfa7fad919bb27b4fe7ca07a to your computer and use it in GitHub Desktop.
napari-pymeshlab error Ubuntu 20.04
(napari) genevieve@genevieve-G5-5500:~$ pip install napari-pymeshlab
Collecting napari-pymeshlab
Using cached napari_pymeshlab-0.0.5-py3-none-any.whl (27 kB)
Requirement already satisfied: npe2 in ./anaconda3/envs/napari/lib/python3.10/site-packages (from napari-pymeshlab) (0.6.2)
Requirement already satisfied: numpy in ./anaconda3/envs/napari/lib/python3.10/site-packages (from napari-pymeshlab) (1.24.2)
Collecting pymeshlab
Downloading pymeshlab-2022.2.post2-cp310-cp310-manylinux1_x86_64.whl (56.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.9/56.9 MB 2.4 MB/s eta 0:00:00
Requirement already satisfied: rich in ./anaconda3/envs/napari/lib/python3.10/site-packages (from npe2->napari-pymeshlab) (13.3.1)
Requirement already satisfied: psygnal>=0.3.0 in ./anaconda3/envs/napari/lib/python3.10/site-packages (from npe2->napari-pymeshlab) (0.7.2)
Requirement already satisfied: appdirs in ./anaconda3/envs/napari/lib/python3.10/site-packages (from npe2->napari-pymeshlab) (1.4.4)
Requirement already satisfied: pydantic in ./anaconda3/envs/napari/lib/python3.10/site-packages (from npe2->napari-pymeshlab) (1.10.5)
Requirement already satisfied: PyYAML in ./anaconda3/envs/napari/lib/python3.10/site-packages (from npe2->napari-pymeshlab) (6.0)
Requirement already satisfied: typer in ./anaconda3/envs/napari/lib/python3.10/site-packages (from npe2->napari-pymeshlab) (0.4.2)
Requirement already satisfied: pytomlpp in ./anaconda3/envs/napari/lib/python3.10/site-packages (from npe2->napari-pymeshlab) (1.0.11)
Requirement already satisfied: build in ./anaconda3/envs/napari/lib/python3.10/site-packages (from npe2->napari-pymeshlab) (0.10.0)
Requirement already satisfied: typing-extensions in ./anaconda3/envs/napari/lib/python3.10/site-packages (from psygnal>=0.3.0->npe2->napari-pymeshlab) (4.4.0)
Requirement already satisfied: mypy-extensions in ./anaconda3/envs/napari/lib/python3.10/site-packages (from psygnal>=0.3.0->npe2->napari-pymeshlab) (1.0.0)
Requirement already satisfied: tomli>=1.1.0 in ./anaconda3/envs/napari/lib/python3.10/site-packages (from build->npe2->napari-pymeshlab) (2.0.1)
Requirement already satisfied: pyproject_hooks in ./anaconda3/envs/napari/lib/python3.10/site-packages (from build->npe2->napari-pymeshlab) (1.0.0)
Requirement already satisfied: packaging>=19.0 in ./anaconda3/envs/napari/lib/python3.10/site-packages (from build->npe2->napari-pymeshlab) (23.0)
Requirement already satisfied: markdown-it-py<3.0.0,>=2.1.0 in ./anaconda3/envs/napari/lib/python3.10/site-packages (from rich->npe2->napari-pymeshlab) (2.2.0)
Requirement already satisfied: pygments<3.0.0,>=2.14.0 in ./anaconda3/envs/napari/lib/python3.10/site-packages (from rich->npe2->napari-pymeshlab) (2.14.0)
Requirement already satisfied: click<9.0.0,>=7.1.1 in ./anaconda3/envs/napari/lib/python3.10/site-packages (from typer->npe2->napari-pymeshlab) (8.1.3)
Requirement already satisfied: mdurl~=0.1 in ./anaconda3/envs/napari/lib/python3.10/site-packages (from markdown-it-py<3.0.0,>=2.1.0->rich->npe2->napari-pymeshlab) (0.1.0)
Installing collected packages: pymeshlab, napari-pymeshlab
Successfully installed napari-pymeshlab-0.0.5 pymeshlab-2022.2.post2
(napari) genevieve@genevieve-G5-5500:~$ ipython
Python 3.10.9 | packaged by conda-forge | (main, Feb 2 2023, 20:20:04) [GCC 11.3.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.10.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import napari
In [2]: viewer = nap
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[2], line 1
----> 1 viewer = nap
NameError: name 'nap' is not defined
In [3]: viewer = napari.Viewer()
Traceback (most recent call last):
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/_command_registry.py", line 33, in resolve
self.function = utils.import_python_name(self.python_name)
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/manifest/utils.py", line 255, in import_python_name
mod = import_module(module_name)
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari_pymeshlab/__init__.py", line 5, in <module>
from ._reader import get_mesh_reader, mesh_reader
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari_pymeshlab/_reader.py", line 1, in <module>
import pymeshlab as ml
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/pymeshlab/__init__.py", line 11, in <module>
from .pmeshlab import *
ImportError: /home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/pymeshlab/lib/libQt5Xml.so.5: undefined symbol: _ZdlPvm, version Qt_5
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py", line 1126, in _open_or_raise_error
added = self._add_layers_with_plugins(
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py", line 1216, in _add_layers_with_plugins
layer_data, hookimpl = read_data_with_plugins(
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/plugins/io.py", line 77, in read_data_with_plugins
res = _npe2.read(paths, plugin, stack=stack)
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/plugins/_npe2.py", line 55, in read
layer_data, reader = io_utils.read_get_reader(
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/io_utils.py", line 66, in read_get_reader
return _read(
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/io_utils.py", line 160, in _read
read_func = rdr.exec(kwargs={"path": paths, "stack": stack})
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/manifest/contributions/_readers.py", line 52, in exec
callable_ = super().exec(kwargs=kwargs)
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/manifest/utils.py", line 62, in exec
return self.get_callable(_registry)(*args, **kwargs)
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/manifest/utils.py", line 72, in get_callable
return _registry.get(self.command)
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/_command_registry.py", line 132, in get
return self._commands[id].resolve()
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/_command_registry.py", line 35, in resolve
raise RuntimeError(
RuntimeError: Failed to import command at 'napari_pymeshlab._reader:get_mesh_reader': /home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/pymeshlab/lib/libQt5Xml.so.5: undefined symbol: _ZdlPvm, version Qt_5
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/_qt/qt_viewer.py", line 830, in _qt_open
self.viewer.open(
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py", line 1024, in open
layers = self._open_or_raise_error(
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py", line 1135, in _open_or_raise_error
raise ReaderPluginError(
napari.errors.reader_errors.ReaderPluginError: Tried opening with napari-pymeshlab, but failed.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/_qt/qt_viewer.py", line 1191, in dropEvent
self._qt_open(
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/_qt/qt_viewer.py", line 838, in _qt_open
handle_gui_reading(
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/_qt/dialogs/qt_reader_dialog.py", line 188, in handle_gui_reading
readers = prepare_remaining_readers(paths, plugin_name, error)
File "/home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/napari/_qt/dialogs/qt_reader_dialog.py", line 243, in prepare_remaining_readers
raise ReaderPluginError(
napari.errors.reader_errors.ReaderPluginError: Tried to read /home/genevieve/Downloads/surface-morphometrics-example-data-20230224T062515Z-001/surface-morphometrics-example-data/morphometrics/TF1_ER.ply with plugin napari-pymeshlab, because it was associated with that file extension/because it is the only plugin capable of reading that path, but it gave an error. Try associating a different plugin or installing a different plugin for this kind of file.
If you suspect this is an IPython 8.10.0 bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True
In [4]: %tb
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/_command_registry.py:33, in CommandHandler.resolve(self)
32 try:
---> 33 self.function = utils.import_python_name(self.python_name)
34 except Exception as e:
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/manifest/utils.py:255, in import_python_name(python_name)
253 module_name, funcname = match.groups() # type: ignore [union-attr]
--> 255 mod = import_module(module_name)
256 return getattr(mod, funcname)
File ~/anaconda3/envs/napari/lib/python3.10/importlib/__init__.py:126, in import_module(name, package)
125 level += 1
--> 126 return _bootstrap._gcd_import(name[level:], package, level)
File <frozen importlib._bootstrap>:1050, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:1027, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:992, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:241, in _call_with_frames_removed(f, *args, **kwds)
File <frozen importlib._bootstrap>:1050, in _gcd_import(name, package, level)
File <frozen importlib._bootstrap>:1027, in _find_and_load(name, import_)
File <frozen importlib._bootstrap>:1006, in _find_and_load_unlocked(name, import_)
File <frozen importlib._bootstrap>:688, in _load_unlocked(spec)
File <frozen importlib._bootstrap_external>:883, in exec_module(self, module)
File <frozen importlib._bootstrap>:241, in _call_with_frames_removed(f, *args, **kwds)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari_pymeshlab/__init__.py:5
2 __version__ = "0.0.5"
----> 5 from ._reader import get_mesh_reader, mesh_reader
6 from ._writer import write_single_surface #, write_multiple
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari_pymeshlab/_reader.py:1
----> 1 import pymeshlab as ml
3 def get_mesh_reader(path):
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/pymeshlab/__init__.py:11
9 os.environ['PATH'] = this_path + os.pathsep + os.environ['PATH']
---> 11 from .pmeshlab import *
12 from .replacer import replace_pymeshlab_filter_names
ImportError: /home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/pymeshlab/lib/libQt5Xml.so.5: undefined symbol: _ZdlPvm, version Qt_5
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py:1126, in ViewerModel._open_or_raise_error(self, paths, kwargs, layer_type, stack)
1125 try:
-> 1126 added = self._add_layers_with_plugins(
1127 paths,
1128 kwargs=kwargs,
1129 stack=stack,
1130 plugin=plugin,
1131 layer_type=layer_type,
1132 )
1133 # plugin failed
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py:1216, in ViewerModel._add_layers_with_plugins(self, paths, stack, kwargs, plugin, layer_type)
1215 assert len(paths) == 1
-> 1216 layer_data, hookimpl = read_data_with_plugins(
1217 paths, plugin=plugin, stack=stack
1218 )
1220 # glean layer names from filename. These will be used as *fallback*
1221 # names, if the plugin does not return a name kwarg in their meta dict.
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/plugins/io.py:77, in read_data_with_plugins(paths, plugin, stack)
75 hookimpl: Optional[HookImplementation]
---> 77 res = _npe2.read(paths, plugin, stack=stack)
78 if res is not None:
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/plugins/_npe2.py:55, in read(paths, plugin, stack)
54 try:
---> 55 layer_data, reader = io_utils.read_get_reader(
56 npe1_path, plugin_name=plugin
57 )
58 return layer_data, _FakeHookimpl(reader.plugin_name)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/io_utils.py:66, in read_get_reader(path, plugin_name, stack)
65 new_path, new_stack = v1_to_v2(path)
---> 66 return _read(
67 new_path, plugin_name=plugin_name, return_reader=True, stack=new_stack
68 )
69 else:
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/io_utils.py:160, in _read(paths, stack, plugin_name, return_reader, _pm)
159 continue
--> 160 read_func = rdr.exec(kwargs={"path": paths, "stack": stack})
161 if read_func is not None:
162 # if the reader function raises an exception here, we don't try to catch it
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/manifest/contributions/_readers.py:52, in ReaderContribution.exec(self, kwargs)
51 kwargs["path"] = v2_to_v1(kwargs["path"], stack)
---> 52 callable_ = super().exec(kwargs=kwargs)
54 if callable_ is None: # pragma: no cover
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/manifest/utils.py:62, in Executable.exec(self, args, kwargs, _registry)
61 kwargs = {}
---> 62 return self.get_callable(_registry)(*args, **kwargs)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/manifest/utils.py:72, in Executable.get_callable(self, _registry)
71 _registry = PluginManager.instance().commands
---> 72 return _registry.get(self.command)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/_command_registry.py:132, in CommandRegistry.get(self, id)
131 raise KeyError(f"command {id!r} not registered")
--> 132 return self._commands[id].resolve()
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/npe2/_command_registry.py:35, in CommandHandler.resolve(self)
34 except Exception as e:
---> 35 raise RuntimeError(
36 f"Failed to import command at {self.python_name!r}: {e}"
37 ) from e
39 return self.function
RuntimeError: Failed to import command at 'napari_pymeshlab._reader:get_mesh_reader': /home/genevieve/anaconda3/envs/napari/lib/python3.10/site-packages/pymeshlab/lib/libQt5Xml.so.5: undefined symbol: _ZdlPvm, version Qt_5
The above exception was the direct cause of the following exception:
ReaderPluginError Traceback (most recent call last)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/_qt/qt_viewer.py:830, in QtViewer._qt_open(self, filenames, stack, choose_plugin, plugin, layer_type, **kwargs)
829 try:
--> 830 self.viewer.open(
831 filenames,
832 stack=stack,
833 plugin=plugin,
834 layer_type=layer_type,
835 **kwargs,
836 )
837 except ReaderPluginError as e:
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py:1024, in ViewerModel.open(self, path, stack, plugin, layer_type, **kwargs)
1022 # no plugin choice was made
1023 else:
-> 1024 layers = self._open_or_raise_error(
1025 _path, kwargs, layer_type, _stack
1026 )
1027 added.extend(layers)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/components/viewer_model.py:1135, in ViewerModel._open_or_raise_error(self, paths, kwargs, layer_type, stack)
1134 except Exception as e:
-> 1135 raise ReaderPluginError(
1136 trans._(
1137 'Tried opening with {plugin}, but failed.',
1138 deferred=True,
1139 plugin=plugin,
1140 ),
1141 plugin,
1142 paths,
1143 ) from e
1144 # multiple plugins
1145 else:
ReaderPluginError: Tried opening with napari-pymeshlab, but failed.
The above exception was the direct cause of the following exception:
ReaderPluginError Traceback (most recent call last)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/_qt/qt_viewer.py:838, in QtViewer._qt_open(self, filenames, stack, choose_plugin, plugin, layer_type, **kwargs)
830 self.viewer.open(
831 filenames,
832 stack=stack,
(...)
835 **kwargs,
836 )
837 except ReaderPluginError as e:
--> 838 handle_gui_reading(
839 filenames,
840 self,
841 stack,
842 e.reader_plugin,
843 e,
844 layer_type=layer_type,
845 **kwargs,
846 )
847 except MultipleReaderError:
848 handle_gui_reading(filenames, self, stack, **kwargs)
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/_qt/dialogs/qt_reader_dialog.py:188, in handle_gui_reading(paths, qt_viewer, stack, plugin_name, error, plugin_override, **kwargs)
161 """Present reader dialog to choose reader and open paths based on result.
162
163 This function is called whenever ViewerModel._open_or_get_error returns
(...)
185 Dictates whether checkbox to remember choice is unchecked by default
186 """
187 _path = paths[0]
--> 188 readers = prepare_remaining_readers(paths, plugin_name, error)
189 error_message = str(error) if error else ''
190 readerDialog = QtReaderDialog(
191 parent=qt_viewer,
192 pth=_path,
(...)
195 persist_checked=not plugin_override,
196 )
File ~/anaconda3/envs/napari/lib/python3.10/site-packages/napari/_qt/dialogs/qt_reader_dialog.py:243, in prepare_remaining_readers(paths, plugin_name, error)
241 # if there's no other readers left, raise the exception
242 if not readers and error:
--> 243 raise ReaderPluginError(
244 trans._(
245 "Tried to read {path_message} with plugin {plugin}, because it was associated with that file extension/because it is the only plugin capable of reading that path, but it gave an error. Try associating a different plugin or installing a different plugin for this kind of file.",
246 path_message=f"[{paths[0]}, ...]"
247 if len(paths) > 1
248 else paths[0],
249 plugin=plugin_name,
250 ),
251 plugin_name,
252 paths,
253 ) from error
255 return readers
ReaderPluginError: Tried to read /home/genevieve/Downloads/surface-morphometrics-example-data-20230224T062515Z-001/surface-morphometrics-example-data/morphometrics/TF1_ER.ply with plugin napari-pymeshlab, because it was associated with that file extension/because it is the only plugin capable of reading that path, but it gave an error. Try associating a different plugin or installing a different plugin for this kind of file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment