nipy / nipype

Workflows and interfaces for neuroimaging packages
https://nipype.readthedocs.org/en/latest/
Other
750 stars 530 forks source link

error(s) on pytest #3482

Closed fazilii closed 2 years ago

fazilii commented 2 years ago

Summary

I am trying to install NiPype on a machine running Ubuntu 20.04.4 LTS (64 bit). pip install -r requirements.txt and pip install -e .[dev] ran successfully without any hindrance. but when i tried to test the implementation by running pytest -v --doctest-modules nipype it gives 3 errors.

Actual behavior

fazili@Ibrahim:~/nipype$ pytest -v --doctest-modules nipype ============================= test session starts ============================== platform linux -- Python 3.8.10, pytest-6.2.2, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3 cachedir: .pytest_cache rootdir: /home/fazili/nipype/nipype, configfile: pytest.ini plugins: timeout-2.1.0, cov-2.11.1, env-0.6.2 collected 2973 items / 3 errors / 2970 selected

==================================== ERRORS ==================================== ERROR collecting sphinxext/documenter.py nipype/sphinxext/documenter.py:3: in from sphinx.ext import autodoc ../.local/lib/python3.8/site-packages/sphinx/ext/autodoc/init.py:24: in from sphinx.application import Sphinx ../.local/lib/python3.8/site-packages/sphinx/application.py:32: in from sphinx.config import Config ../.local/lib/python3.8/site-packages/sphinx/config.py:27: in from sphinx.util.tags import Tags ../.local/lib/python3.8/site-packages/sphinx/util/tags.py:11: in from jinja2 import nodes ../.local/lib/python3.8/site-packages/jinja2/init.py:12: in from .environment import Environment ../.local/lib/python3.8/site-packages/jinja2/environment.py:25: in from .defaults import BLOCK_END_STRING ../.local/lib/python3.8/site-packages/jinja2/defaults.py:3: in from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401 ../.local/lib/python3.8/site-packages/jinja2/filters.py:13: in from markupsafe import soft_unicode E ImportError: cannot import name 'softunicode' from 'markupsafe' (/home/fazili/.local/lib/python3.8/site-packages/markupsafe/init.py) ____ ERROR collecting sphinxext/apidoc/init.py ____ nipype/sphinxext/apidoc/init.py:5: in from sphinx.ext.napoleon import ( ../.local/lib/python3.8/site-packages/sphinx/ext/napoleon/init.py:14: in from sphinx.application import Sphinx ../.local/lib/python3.8/site-packages/sphinx/application.py:32: in from sphinx.config import Config ../.local/lib/python3.8/site-packages/sphinx/config.py:27: in from sphinx.util.tags import Tags ../.local/lib/python3.8/site-packages/sphinx/util/tags.py:11: in from jinja2 import nodes ../.local/lib/python3.8/site-packages/jinja2/init.py:12: in from .environment import Environment ../.local/lib/python3.8/site-packages/jinja2/environment.py:25: in from .defaults import BLOCK_END_STRING ../.local/lib/python3.8/site-packages/jinja2/defaults.py:3: in from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401 ../.local/lib/python3.8/site-packages/jinja2/filters.py:13: in from markupsafe import soft_unicode E ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/fazili/.local/lib/python3.8/site-packages/markupsafe/init.py) ____ ERROR collecting sphinxext/apidoc/docstring.py ____ /usr/lib/python3.8/importlib/init.py:127: in import_module return _bootstrap._gcd_import(name[level:], package, level)

:1014: in _gcd_import ??? :991: in _find_and_load ??? :961: in _find_and_load_unlocked ??? :219: in _call_with_frames_removed ??? :1014: in _gcd_import ??? :991: in _find_and_load ??? :975: in _find_and_load_unlocked ??? :671: in _load_unlocked ??? :848: in exec_module ??? :219: in _call_with_frames_removed ??? nipype/sphinxext/apidoc/__init__.py:5: in from sphinx.ext.napoleon import ( ../.local/lib/python3.8/site-packages/sphinx/ext/napoleon/__init__.py:14: in from sphinx.application import Sphinx ../.local/lib/python3.8/site-packages/sphinx/application.py:32: in from sphinx.config import Config ../.local/lib/python3.8/site-packages/sphinx/config.py:27: in from sphinx.util.tags import Tags ../.local/lib/python3.8/site-packages/sphinx/util/tags.py:11: in from jinja2 import nodes ../.local/lib/python3.8/site-packages/jinja2/__init__.py:12: in from .environment import Environment ../.local/lib/python3.8/site-packages/jinja2/environment.py:25: in from .defaults import BLOCK_END_STRING ../.local/lib/python3.8/site-packages/jinja2/defaults.py:3: in from .filters import FILTERS as DEFAULT_FILTERS # noqa: F401 ../.local/lib/python3.8/site-packages/jinja2/filters.py:13: in from markupsafe import soft_unicode E ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/fazili/.local/lib/python3.8/site-packages/markupsafe/__init__.py) =============================== warnings summary =============================== nipype/interfaces/io.py:1406 /home/fazili/nipype/nipype/interfaces/io.py:1406: DeprecationWarning: invalid escape sequence \w field_name = re.match("\w+", field_name).group() nipype/interfaces/utility/base.py:232 /home/fazili/nipype/nipype/interfaces/utility/base.py:232: DeprecationWarning: invalid escape sequence \w """Change the name of a file based on a mapped format string. ../.local/lib/python3.8/site-packages/dipy/denoise/patch2self.py:11 /home/fazili/.local/lib/python3.8/site-packages/dipy/denoise/patch2self.py:11: UserWarning: We need package sklearn for these functions, but ``import sklearn`` raised an ImportError warn(sklearn._msg) nipype/interfaces/mrtrix/convert.py:6 /home/fazili/nipype/nipype/interfaces/mrtrix/convert.py:6: DeprecationWarning: The trackvis interface has been deprecated and will be removed in v4.0; please use the 'nibabel.streamlines' interface. import nibabel.trackvis as trk nipype/workflows/__init__.py:28 /home/fazili/nipype/nipype/workflows/__init__.py:28: UserWarning: Nipype 1 workflows have been moved to the niflow-nipype1-workflows package. pip install niflow-nipype1-workflows to continue using them. warnings.warn(" ".join(_msg)) -- Docs: https://docs.pytest.org/en/stable/warnings.html =========================== short test summary info ============================ ERROR nipype/sphinxext/documenter.py - ImportError: cannot import name 'soft_... ERROR nipype/sphinxext/apidoc/__init__.py - ImportError: cannot import name '... ERROR nipype/sphinxext/apidoc/docstring.py - ImportError: cannot import name ... !!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!! ======================== 5 warnings, 3 errors in 14.17s ======================== ### Expected behavior something along the lines 2445 passed, 41 skipped, 7 xfailed in 1277.66 seconds ### How to replicate the behavior ### Script/Workflow details Please put URL to code or code here (if not too long). ### Platform details: ``` ``` ### Execution environment Choose one - Container [Tag: ???] - My python environment inside container [Base Tag: ???] - My python environment outside container
effigies commented 2 years ago

From the error, my guess is you need to upgrade jinja2. There have been some breakages in the ecosystem, but most got smoothed over a month or two ago.

fazilii commented 2 years ago

From the error, my guess is you need to upgrade jinja2.

actually jinja2 wasn't that needed upgrading. Rather it was Sphinx, which was throwing importError while importing from jinja2. but once i updated it, all errors were resolved.

effigies commented 2 years ago

Glad to hear it's resolved.