AndreasHeger / gat

Genomic Association Tester
28 stars 15 forks source link

Getting requirements to build wheel... error #17

Open alexbisias opened 5 days ago

alexbisias commented 5 days ago

Hello, I've been trying to install gat per the instructions in https://gat.readthedocs.io/en/latest/installation.html but have been getting the following error when running pip install gat:

`Collecting gat Using cached gat-1.3.6.tar.gz (88 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [23 lines of output] Traceback (most recent call last): File "", line 23, in ModuleNotFoundError: No module named 'numpy'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/Users/alexbisia/env_gat/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/Users/alexbisia/env_gat/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/alexbisia/env_gat/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/private/var/folders/qy/0918mg313jl6tv_knh60fgkc0000gn/T/pip-build-env-uaia8yk_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
    File "/private/var/folders/qy/0918mg313jl6tv_knh60fgkc0000gn/T/pip-build-env-uaia8yk_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/qy/0918mg313jl6tv_knh60fgkc0000gn/T/pip-build-env-uaia8yk_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 497, in run_setup
      super().run_setup(setup_script=setup_script)
    File "/private/var/folders/qy/0918mg313jl6tv_knh60fgkc0000gn/T/pip-build-env-uaia8yk_/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 313, in run_setup
      exec(code, locals())
    File "<string>", line 25, in <module>
  ImportError: GAT requires numpy to be installed before running setup.py (pip install numpy)
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.`

The error message says "No module named 'numpy'" but I have just installed it. Do you have any idea why this error is appearing? Thanks in advance.

alexbisias commented 4 days ago

I've also been trying to install gat without a virtual environment and have been getting the following error output:

`Compiling gat/CoordinateList.pyx because it changed. [1/1] Cythonizing gat/CoordinateList.pyx /Users/alexbisia/miniconda3/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /Users/alexbisia/Downloads/gat-1.3.6/gat/CoordinateList.pxd tree = Parsing.p_module(s, pxd, full_module_name) building 'gat.CoordinateList' extension creating build/temp.macosx-10.9-x86_64-cpython-39 creating build/temp.macosx-10.9-x86_64-cpython-39/gat creating build/temp.macosx-10.9-x86_64-cpython-39/utils x86_64-apple-darwin13.4.0-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/alexbisia/miniconda3/include -arch x86_64 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/alexbisia/miniconda3/include -arch x86_64 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/alexbisia/miniconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/alexbisia/miniconda3/include -I./utils -I/Users/alexbisia/miniconda3/lib/python3.9/site-packages/numpy/_core/include -I/Users/alexbisia/miniconda3/include/python3.9 -c gat/CoordinateList.c -o build/temp.macosx-10.9-x86_64-cpython-39/gat/CoordinateList.o x86_64-apple-darwin13.4.0-clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/alexbisia/miniconda3/include -arch x86_64 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/alexbisia/miniconda3/include -arch x86_64 -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/alexbisia/miniconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/alexbisia/miniconda3/include -I./utils -I/Users/alexbisia/miniconda3/lib/python3.9/site-packages/numpy/_core/include -I/Users/alexbisia/miniconda3/include/python3.9 -c utils/gat_utils.c -o build/temp.macosx-10.9-x86_64-cpython-39/utils/gat_utils.o x86_64-apple-darwin13.4.0-clang -bundle -undefined dynamic_lookup -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/alexbisia/miniconda3/lib -L/Users/alexbisia/miniconda3/lib -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/alexbisia/miniconda3/lib -L/Users/alexbisia/miniconda3/lib -Wl,-pie -Wl,-headerpad_max_install_names -Wl,-dead_strip_dylibs -Wl,-rpath,/Users/alexbisia/miniconda3/lib -L/Users/alexbisia/miniconda3/lib -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O2 -pipe -isystem /Users/alexbisia/miniconda3/include -D_FORTIFY_SOURCE=2 -isystem /Users/alexbisia/miniconda3/include build/temp.macosx-10.9-x86_64-cpython-39/gat/CoordinateList.o build/temp.macosx-10.9-x86_64-cpython-39/utils/gat_utils.o -lz -o build/lib.macosx-10.9-x86_64-cpython-39/gat/CoordinateList.cpython-39-darwin.so ld: warning: -pie being ignored. It is only used when linking a main executable Compiling gat/SegmentList.pyx because it changed. [1/1] Cythonizing gat/SegmentList.pyx /Users/alexbisia/miniconda3/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'language_level' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /Users/alexbisia/Downloads/gat-1.3.6/gat/SegmentList.pxd tree = Parsing.p_module(s, pxd, full_module_name)

Error compiling Cython file:

... from libc.stdio cimport FILE from posix.types cimport off_t

from CoordinateList cimport CoordinateList ^

gat/SegmentList.pxd:4:0: 'CoordinateList.pxd' not found

Error compiling Cython file:

... from libc.stdio cimport FILE from posix.types cimport off_t

from CoordinateList cimport CoordinateList ^

gat/SegmentList.pxd:4:0: 'CoordinateList/CoordinateList.pxd' not found

Error compiling Cython file:

...

##################################################### #####################################################

definition of segmentlist

##################################################### cdef class SegmentList(CoordinateList): ^

gat/SegmentList.pxd:44:23: First base of 'SegmentList' is not an extension type

Error compiling Cython file:

...

numpy import

both import and cimport are necessary

import numpy cimport numpy DTYPE_INT = numpy.int ctypedef numpy.int_t DTYPE_INT_t ^

gat/SegmentList.pyx:57:9: 'int_t' is not a type identifier

Error compiling Cython file:

... return

    qsort(<void*>self.segments,
          self.nsegments,
          sizeof(Segment),
          &cmpSegments)
          ^

gat/SegmentList.pyx:486:14: Cannot assign type 'int ()(const_void_ptr, const_void_ptr) except? -1 nogil' to 'int ()(const void , const void ) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to the type of the value being assigned.

Error compiling Cython file:

...

    idx = searchsorted(self.segments,
                       self.nsegments,
                       sizeof(Segment),
                       &other,
                       &cmpSegments)
                       ^

gat/SegmentList.pyx:880:27: Cannot assign type 'int ()(const_void_ptr, const_void_ptr) except? -1 nogil' to 'int ()(void , void ) noexcept'. Exception values are incompatible. Suggest adding 'noexcept' to the type of the value being assigned.`

minghuaxu commented 2 days ago

I met the same error.Have you solved this problem?

alexbisias commented 2 days ago

Unfortunately not yet!

minghuaxu commented 2 days ago

I successfully installed gat, maybe you can try my package version。 pip install python==3.6 pip install numpy==1.16.0 pip install cython==0.29.3 pip install gat==1.3.6 my setuptools version is 58.0.4, but I think its doesn`t matter, I hope this can help you.