nipy / nibabel

Python package to access a cacophony of neuro-imaging file formats
http://nipy.org/nibabel/
Other
649 stars 258 forks source link

TypeError of import nibabel will be displayed after running make html #1232

Closed lincong8722 closed 1 year ago

lincong8722 commented 1 year ago

When I use sphinx for document generation, run make html after quoting the function, and an error of nibabel will be displayed, as follows:

WARNING: autodoc: failed to import module 'node' from module 'src.interface'; the following exception was raised:
Traceback (most recent call last):
  File "/home/cc/anaconda3/envs/3.8/lib/python3.8/site-packages/sphinx/ext/autodoc/importer.py", line 66, in import_module
    return importlib.import_module(modname)
  File "/home/cc/anaconda3/envs/3.8/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/cc/workspace/project/src/interface/node.py", line 6, in <module>
    import nibabel as nib
  File "/home/cc/anaconda3/envs/3.8/lib/python3.8/site-packages/nibabel/__init__.py", line 40, in <module>
    from . import analyze as ana
  File "/home/cc/anaconda3/envs/3.8/lib/python3.8/site-packages/nibabel/analyze.py", line 87, in <module>
    from .volumeutils import (native_code, swapped_code, make_dt_codes,
  File "/home/cc/anaconda3/envs/3.8/lib/python3.8/site-packages/nibabel/volumeutils.py", line 21, in <module>
    from .casting import (shared_range, type_info, OK_FLOATS)
  File "/home/cc/anaconda3/envs/3.8/lib/python3.8/site-packages/nibabel/casting.py", line 678, in <module>
    _LD_LTE_FLOAT64 = longdouble_lte_float64()
  File "/home/cc/anaconda3/envs/3.8/lib/python3.8/site-packages/nibabel/casting.py", line 674, in longdouble_lte_float64
    return np.longdouble(2**53) == np.longdouble(2**53) + 1
TypeError: unsupported operand type(s) for +: 'longdouble' and 'int'

I am using nibabel ==3.2.2 When I run node.py alone, it can run, but once I use sphinx to generate the document, I will report an error. I don't know where the problem is. How can I solve this error?