You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to import skeletons via pymaid, we get this error:
{
"error": "Could not import 'custom_rest_swagger_googledoc.get_googledocstring' for API setting 'VIEW_DESCRIPTION_FUNCTION'. ModuleNotFoundError: No module named 'sphinx'.",
"detail": "Traceback (most recent call last):\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/rest_framework/settings.py\", line 179, in import_from_string\n return import_string(val)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/django/utils/module_loading.py\", line 30, in import_string\n return cached_import(module_path, class_name)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/django/utils/module_loading.py\", line 15, in cached_import\n module = import_module(module_path)\n File \"/usr/lib/python3.10/importlib/__init__.py\", line 126, in import_module\n return _bootstrap._gcd_import(name[level:], package, level)\n File \"\u003Cfrozen importlib._bootstrap\u003E\", line 1050, in _gcd_import\n File \"\u003Cfrozen importlib._bootstrap\u003E\", line 1027, in _find_and_load\n File \"\u003Cfrozen importlib._bootstrap\u003E\", line 1006, in _find_and_load_unlocked\n File \"\u003Cfrozen importlib._bootstrap\u003E\", line 688, in _load_unlocked\n File \"\u003Cfrozen importlib._bootstrap_external\u003E\", line 883, in exec_module\n File \"\u003Cfrozen importlib._bootstrap\u003E\", line 241, in _call_with_frames_removed\n File \"/opt/catmaid/fibsem/django/lib/custom_rest_swagger_googledoc.py\", line 8, in \u003Cmodule\u003E\n from sphinx.ext.napoleon import Config\nModuleNotFoundError: No module named 'sphinx'\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/django/core/handlers/base.py\", line 220, in _get_response\n response = response.render()\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/django/template/response.py\", line 114, in render\n self.content = self.rendered_content\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/rest_framework/response.py\", line 74, in rendered_content\n ret = renderer.render(self.data, accepted_media_type, context)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/rest_framework/renderers.py\", line 727, in render\n context = self.get_context(data, accepted_media_type, renderer_context)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/rest_framework/renderers.py\", line 689, in get_context\n 'description': self.get_description(view, response.status_code),\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/rest_framework/renderers.py\", line 604, in get_description\n return view.get_view_description(html=True)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/rest_framework/views.py\", line 244, in get_view_description\n func = self.settings.VIEW_DESCRIPTION_FUNCTION\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/rest_framework/settings.py\", line 227, in __getattr__\n val = perform_import(val, attr)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/rest_framework/settings.py\", line 168, in perform_import\n return import_from_string(val, setting_name)\n File \"/opt/catmaid/fibsem/django/env/lib/python3.10/site-packages/rest_framework/settings.py\", line 182, in import_from_string\n raise ImportError(msg)\nImportError: Could not import 'custom_rest_swagger_googledoc.get_googledocstring' for API setting 'VIEW_DESCRIPTION_FUNCTION'. ModuleNotFoundError: No module named 'sphinx'.\n",
"type": "ImportError",
"meta": null
}
Likely the 'sphinx' python package is missing from the requirements text files for building the python virtual environment.
The text was updated successfully, but these errors were encountered:
sphinx is usually only needed for building the documentation and is part of the requirements-doc.txt requirements file. It looks like pymaid tries to access an endpoint that returns the documentation HTML rather than the requested content (maybe because the Content-Type header wasn't set to application/json?).
Accessing the HTML version of some endpoints for documentation purposes seems useful generally and I think it would make sense to move the "doc" requirement into the main requirements.txt file.
This is useful for consuming API documentation on a CATMAID instance.
Some DRF endpoints allow to show API documentation when called with a
regular GET request from the browser. This prevents CATMAID raising an
import error in these cases and instead shows the API documentation
HTML. Apparantly, there are also cases where `pymaid` would cause
similar error responses without `sphinx`. This should be fixes with this
commit as well.
Fixes#2282
When attempting to import skeletons via pymaid, we get this error:
Likely the 'sphinx' python package is missing from the requirements text files for building the python virtual environment.
The text was updated successfully, but these errors were encountered: