brentp / fishers_exact_test

Fishers Exact Test for Python (Cython)
BSD 3-Clause "New" or "Revised" License
62 stars 21 forks source link

Numpy import/compilation error #45

Closed tristanbrown closed 9 months ago

tristanbrown commented 9 months ago

Starting today, with fisher==0.1.12 through fisher==0.1.14 and numpy=1.22.4, I'm getting an error upon import:

Traceback (most recent call last):
  File "__init__.cython-30.pxd", line 984, in numpy.import_array
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf . Check the section C-API incompatibility at the Troubleshooting ImportError section at https://numpy.org/devdocs/user/troubleshooting-importerror.html#c-api-incompatibility for indications on how to solve this problem .

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3460, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-2-9c21a9dafb7e>", line 1, in <module>
    import fisher
  File "/opt/conda/lib/python3.8/site-packages/fisher/__init__.py", line 3, in <module>
    from .cfisher import *
  File "src/cfisher.pyx", line 30, in init fisher.cfisher
  File "__init__.cython-30.pxd", line 986, in numpy.import_array
ImportError: numpy.core.multiarray failed to import

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 2057, in showtraceback
    stb = self.InteractiveTB.structured_traceback(
  File "/opt/conda/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1288, in structured_traceback
    return FormattedTB.structured_traceback(
  File "/opt/conda/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1177, in structured_traceback
    return VerboseTB.structured_traceback(
  File "/opt/conda/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1049, in structured_traceback
    formatted_exceptions += self.format_exception_as_a_whole(etype, evalue, etb, lines_of_context,
  File "/opt/conda/lib/python3.8/site-packages/IPython/core/ultratb.py", line 935, in format_exception_as_a_whole
    self.get_records(etb, number_of_lines_of_context, tb_offset) if etb else []
  File "/opt/conda/lib/python3.8/site-packages/IPython/core/ultratb.py", line 1003, in get_records
    lines, first = inspect.getsourcelines(etb.tb_frame)
  File "/opt/conda/lib/python3.8/inspect.py", line 979, in getsourcelines
    lines, lnum = findsource(object)
  File "/opt/conda/lib/python3.8/inspect.py", line 798, in findsource
    raise OSError('could not get source code')
OSError: could not get source code

Pinning fisher<0.1.11 resolves the exception.

If I try to pin any version range that includes v0.1.11, I get another error upon install: ModuleNotFoundError: No module named 'versioneer'

brentp commented 9 months ago

Hi @tristanbrown , you caught me in the middle of trying to get this fix. If you update to the latest release, I think it resolves this issue. Please re-open if that's not the case.

tristanbrown commented 9 months ago

@brentp Yes, I'm experiencing this with v0.1.14, after the latest commit.