-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
49af8fc
commit 7a022f5
Showing
3 changed files
with
111 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "2ee026a3-6483-4027-b39a-6b1d844d475d", | ||
"metadata": { | ||
"tags": [] | ||
}, | ||
"outputs": [ | ||
{ | ||
"ename": "TypeError", | ||
"evalue": "QtBindingsNotFoundError.__init__() takes 1 positional argument but 2 were given", | ||
"output_type": "error", | ||
"traceback": [ | ||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | ||
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", | ||
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/qtpy/__init__.py:252\u001b[0m\n\u001b[1;32m 251\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 252\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mPySide6\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m __version__ \u001b[38;5;28;01mas\u001b[39;00m PYSIDE_VERSION \u001b[38;5;66;03m# analysis:ignore\u001b[39;00m\n\u001b[1;32m 253\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mPySide6\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mQtCore\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m __version__ \u001b[38;5;28;01mas\u001b[39;00m QT_VERSION \u001b[38;5;66;03m# analysis:ignore\u001b[39;00m\n", | ||
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'PySide6'", | ||
"\nDuring handling of the above exception, another exception occurred:\n", | ||
"\u001b[0;31mQtBindingsNotFoundError\u001b[0m Traceback (most recent call last)", | ||
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/napari/_qt/__init__.py:9\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m----> 9\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mqtpy\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m API_NAME, QtCore\n\u001b[1;32m 10\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n", | ||
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/qtpy/__init__.py:259\u001b[0m\n\u001b[1;32m 258\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mImportError\u001b[39;00m:\n\u001b[0;32m--> 259\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m QtBindingsNotFoundError()\n\u001b[1;32m 260\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n", | ||
"\u001b[0;31mQtBindingsNotFoundError\u001b[0m: No Qt bindings could be found", | ||
"\nDuring handling of the above exception, another exception occurred:\n", | ||
"\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", | ||
"Cell \u001b[0;32mIn[2], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mnapari\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mnapari\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mqt\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mthreading\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m thread_worker\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mjupyter_rfb\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m RemoteFrameBuffer\n\u001b[1;32m 4\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01mskimage\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m data\n", | ||
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/napari/qt/__init__.py:1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_qt\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mqt_event_loop\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m get_app, run\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_qt\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mqt_main_window\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m Window\n\u001b[1;32m 3\u001b[0m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01m_qt\u001b[39;00m\u001b[38;5;21;01m.\u001b[39;00m\u001b[38;5;21;01mqt_resources\u001b[39;00m \u001b[38;5;28;01mimport\u001b[39;00m get_current_stylesheet, get_stylesheet\n", | ||
"File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/napari/_qt/__init__.py:12\u001b[0m\n\u001b[1;32m 10\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[1;32m 11\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mNo Qt bindings could be found\u001b[39m\u001b[38;5;124m'\u001b[39m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28mstr\u001b[39m(e):\n\u001b[0;32m---> 12\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28;43mtype\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43me\u001b[49m\u001b[43m)\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 13\u001b[0m \u001b[43m \u001b[49m\u001b[43mtrans\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 14\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mNo Qt bindings could be found.\u001b[39;49m\u001b[38;5;130;43;01m\\n\u001b[39;49;00m\u001b[38;5;130;43;01m\\n\u001b[39;49;00m\u001b[38;5;124;43mnapari requires either PyQt5 or PySide2 to be installed in the environment.\u001b[39;49m\u001b[38;5;130;43;01m\\n\u001b[39;49;00m\u001b[38;5;124;43mTo install the default backend (currently PyQt5), run \u001b[39;49m\u001b[38;5;130;43;01m\\\"\u001b[39;49;00m\u001b[38;5;124;43mpip install napari[all]\u001b[39;49m\u001b[38;5;130;43;01m\\\"\u001b[39;49;00m\u001b[38;5;124;43m \u001b[39;49m\u001b[38;5;130;43;01m\\n\u001b[39;49;00m\u001b[38;5;124;43mYou may also use \u001b[39;49m\u001b[38;5;130;43;01m\\\"\u001b[39;49;00m\u001b[38;5;124;43mpip install napari[pyside2]\u001b[39;49m\u001b[38;5;130;43;01m\\\"\u001b[39;49;00m\u001b[38;5;124;43mfor Pyside2, or \u001b[39;49m\u001b[38;5;130;43;01m\\\"\u001b[39;49;00m\u001b[38;5;124;43mpip install napari[pyqt5]\u001b[39;49m\u001b[38;5;130;43;01m\\\"\u001b[39;49;00m\u001b[38;5;124;43m for PyQt5\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m 15\u001b[0m \u001b[43m \u001b[49m\u001b[43mdeferred\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43;01mTrue\u001b[39;49;00m\u001b[43m,\u001b[49m\n\u001b[1;32m 16\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 17\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 18\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m\n\u001b[1;32m 21\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m API_NAME \u001b[38;5;241m==\u001b[39m \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mPySide2\u001b[39m\u001b[38;5;124m'\u001b[39m:\n\u001b[1;32m 22\u001b[0m \u001b[38;5;66;03m# Set plugin path appropriately if using PySide2. This is a bug fix\u001b[39;00m\n\u001b[1;32m 23\u001b[0m \u001b[38;5;66;03m# for when both PyQt5 and Pyside2 are installed\u001b[39;00m\n", | ||
"\u001b[0;31mTypeError\u001b[0m: QtBindingsNotFoundError.__init__() takes 1 positional argument but 2 were given" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import napari\n", | ||
"from napari.qt.threading import thread_worker\n", | ||
"from jupyter_rfb import RemoteFrameBuffer\n", | ||
"from skimage import data\n", | ||
"a = data.astronaut()\n", | ||
"viewer = napari.Viewer()\n", | ||
"viewer.add_image(a)\n", | ||
"\n", | ||
"class LiveViewer(RemoteFrameBuffer):\n", | ||
" def __init__(self, viewer: napari.Viewer):\n", | ||
" super().__init__()\n", | ||
" self.viewer = viewer\n", | ||
" \n", | ||
" def get_frame(self):\n", | ||
" return self.viewer.screenshot(canvas_only=False, flash=False)\n", | ||
" \n", | ||
" def handle_event(self, event):\n", | ||
" self.request_draw()\n", | ||
" \n", | ||
"live_viewer = LiveViewer(viewer)\n", | ||
"live_viewer" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "edaeda7a-cbc2-4e52-b6c7-07fbf3df77d2", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3 (ipykernel)", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.9" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,3 +40,5 @@ gravis | |
pyimagej | ||
itkwidgets | ||
napari | ||
PySide6 | ||
jupyter-rfb |