open2c / cooltools

The tools for your .cool's
MIT License
140 stars 51 forks source link

Unable to install cooltools #524

Closed yuri-practice-only closed 1 month ago

yuri-practice-only commented 5 months ago

I was trying to install the cooltools into my python environment using pip3 install cooltools. However, I kept receiving an error message:

my@computer ~ % pip install cooltools
Collecting cooltools Using cached cooltools-0.7.0.tar.gz (8.7 MB) 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 ╰─> [37 lines of output] /private/var/folders/y_/9sxy4l6n5d3329xwtr6t2vk80000gr/T/pip-build-env-e3kfsm45/overlay/lib/python3.9/site-packages/Cython/Compiler/Main.py:381: FutureWarning: Cython directive 'languagelevel' not set, using '3str' for now (Py3). This has changed from earlier releases! File: /private/var/folders/y/9sxy4l6n5d3329xwtr6t2vk80000gr/T/pip-install-_63_h7_q/cooltools_c8ff5a7c736d43599597b9c164e5a469/cooltools/lib/_numutils.pyx tree = Parsing.p_module(s, pxd, full_module_name)

  Error compiling Cython file:
  ------------------------------------------------------------
  ...
  @cython.wraparound(False)
  @cython.nonecheck(False)
  @cython.cdivision(True)
  def _matvec_sparse_symmetric(
          np.ndarray[np.double_t, ndim=1] y,
          np.ndarray[np.int_t, ndim=1] bin1,
                        ^
  ------------------------------------------------------------

  cooltools/lib/_numutils.pyx:233:22: Invalid type.
  Compiling cooltools/lib/_numutils.pyx because it depends on /private/var/folders/y_/9sxy4l6n5d3329xwtr6t2vk80000gr/T/pip-build-env-e3kfsm45/overlay/lib/python3.9/site-packages/Cython/Includes/libc/string.pxd.
  [1/1] Cythonizing cooltools/lib/_numutils.pyx
  Traceback (most recent call last):
    File "/Users/xin/Library/r-miniconda-arm64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File "/Users/xin/Library/r-miniconda-arm64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/Users/my/Library/r-miniconda-arm64/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 130, in get_requires_for_build_wheel
      return hook(config_settings)
    File "/private/var/folders/y_/9sxy4l6n5d3329xwtr6t2vk80000gr/T/pip-build-env-e3kfsm45/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/y_/9sxy4l6n5d3329xwtr6t2vk80000gr/T/pip-build-env-e3kfsm45/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
      self.run_setup()
    File "/private/var/folders/y_/9sxy4l6n5d3329xwtr6t2vk80000gr/T/pip-build-env-e3kfsm45/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 313, in run_setup
      exec(code, locals())
    File "<string>", line 89, in <module>
    File "/private/var/folders/y_/9sxy4l6n5d3329xwtr6t2vk80000gr/T/pip-build-env-e3kfsm45/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize
      cythonize_one(*args)
    File "/private/var/folders/y_/9sxy4l6n5d3329xwtr6t2vk80000gr/T/pip-build-env-e3kfsm45/overlay/lib/python3.9/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one
      raise CompileError(None, pyx_file)
  Cython.Compiler.Errors.CompileError: cooltools/lib/_numutils.pyx
  [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.

And here are all packages I installed in my python environment:

Package Version


appnope 0.1.3 asciitree 0.3.3 asttokens 2.4.1 backcall 0.2.0 biopython 1.81 brotlipy 0.7.0 certifi 2022.5.18.1 cffi 1.15.0 charset-normalizer 2.0.12 click 8.1.7 colorama 0.4.4 comm 0.2.1 conda 4.12.0 conda-package-handling 1.8.1 contourpy 1.2.0 cooler 0.10.2 cryptography 37.0.2 cycler 0.12.1 cytoolz 0.12.3 debugpy 1.8.0 decorator 5.1.1 dill 0.3.8 executing 2.0.1 fonttools 4.47.2 fuzzywuzzy 0.18.0 h5py 3.11.0 idna 3.3 importlib-metadata 7.0.1 importlib-resources 6.1.1 ipykernel 6.29.0 ipython 8.12.0 jedi 0.19.1 jupyter_client 8.6.0 jupyter_core 5.7.1 kiwisolver 1.4.5 Levenshtein 0.21.1 matplotlib 3.8.2 matplotlib-inline 0.1.6 multiprocess 0.70.16 nest_asyncio 1.6.0 numpy 1.24.3 packaging 23.2 pandas 2.0.1 parso 0.8.3 patsy 0.5.6 pexpect 4.8.0 pickleshare 0.7.5 pillow 10.2.0 pip 22.1.2 platformdirs 4.1.0 prompt-toolkit 3.0.42 psutil 5.9.8 ptyprocess 0.7.0 pure-eval 0.2.2 pycosat 0.6.3 pycparser 2.21 pyfaidx 0.8.1.1 Pygments 2.17.2 pyOpenSSL 22.0.0 pyparsing 3.1.1 pysam 0.22.0 PySocks 1.7.1 python-dateutil 2.8.2 python-Levenshtein 0.21.1 pytz 2023.3 PyYAML 6.0.1 pyzmq 25.1.2 rapidfuzz 3.2.0 requests 2.27.1 ruamel-yaml-conda 0.15.80 scipy 1.12.0 setuptools 62.3.2 simplejson 3.19.2 six 1.16.0 stack-data 0.6.2 statsmodels 0.14.1 toolz 0.12.1 tornado 6.3.3 tqdm 4.64.0 traitlets 5.14.1 typing_extensions 4.9.0 tzdata 2023.3 urllib3 1.26.9 wcwidth 0.2.13 wheel 0.37.1 zipp 3.17.0

I would really appreciate any thoughts and comments. Thank you.

davidhbrann commented 4 months ago

I also encountered this same error. It looks like it was fixed in cca91ef4ef2c5cdb814edfd5704d941603a752b5 so you can clone this repo and then install it with pip install -e . as specific in the instructions here.

gfudenberg commented 1 month ago

thanks @davidhbrann for tracking down the bugfix -- please re-open @yuri-practice-only if that didn't resolve!