Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation error #890

Closed
mikewojnowicz opened this issue Jun 22, 2024 · 9 comments
Closed

Installation error #890

mikewojnowicz opened this issue Jun 22, 2024 · 9 comments

Comments

@mikewojnowicz
Copy link

Hi, I'm running Python 3.11.5.  I am running a 2023 Macbook Pro; hence, I am using the arm64 version of Python (for the M1 or M2 chips), and not the x86_64 version of Python (for an Intel chip). The command pip install cnvkit gave the following error message below. Do you have any advice? Thank you.

⇒  pip install cnvkit
Collecting cnvkit
  Using cached CNVkit-0.9.11.tar.gz (176 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting biopython>=1.80 (from cnvkit)
  Using cached biopython-1.83-cp311-cp311-macosx_11_0_arm64.whl.metadata (13 kB)
Requirement already satisfied: matplotlib>=3.5.2 in ./deactivate/lib/python3.11/site-packages (from cnvkit) (3.9.0)
Requirement already satisfied: numpy>=1.24.2 in ./deactivate/lib/python3.11/site-packages (from cnvkit) (1.26.4)
Requirement already satisfied: pandas>=1.5.3 in ./deactivate/lib/python3.11/site-packages (from cnvkit) (2.2.2)
Collecting pomegranate<=0.14.9,>=0.14.8 (from cnvkit)
  Using cached pomegranate-0.14.9.tar.gz (4.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
  ╰─> [75 lines of output]
      
      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      
      cpdef disable_gpu():
          global GPU
          GPU = False
      
      cdef ndarray_wrap_cpointer(void* data, numpy.npy_intp n):
          ^
      ------------------------------------------------------------
      
      pomegranate/utils.pyx:120:5: Function signature does not match previous declaration
      Compiling pomegranate/BayesClassifier.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/BayesianNetwork.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/FactorGraph.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/MarkovNetwork.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/NaiveBayes.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/base.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/bayes.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/gmm.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/hmm.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/kmeans.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/scipy/linalg/cython_blas.pxd.
      Compiling pomegranate/parallel.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/utils.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/scipy/linalg/cython_blas.pxd.
      Compiling pomegranate/distributions/BernoulliDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/BetaDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/ConditionalProbabilityTable.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/DirichletDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/DiscreteDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/ExponentialDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/GammaDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/IndependentComponentsDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/JointProbabilityTable.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/KernelDensities.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/LogNormalDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/MultivariateGaussianDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/scipy/linalg/cython_blas.pxd.
      Compiling pomegranate/distributions/NormalDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/PoissonDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/UniformDistribution.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      Compiling pomegranate/distributions/distributions.pyx because it depends on /private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Includes/libc/string.pxd.
      [ 1/28] Cythonizing pomegranate/BayesianNetwork.pyx
      [ 2/28] Cythonizing pomegranate/MarkovNetwork.pyx
      [ 3/28] Cythonizing pomegranate/distributions/ConditionalProbabilityTable.pyx
      [ 4/28] Cythonizing pomegranate/distributions/IndependentComponentsDistribution.pyx
      [ 5/28] Cythonizing pomegranate/distributions/JointProbabilityTable.pyx
      [ 6/28] Cythonizing pomegranate/distributions/MultivariateGaussianDistribution.pyx
      [ 7/28] Cythonizing pomegranate/hmm.pyx
      [ 8/28] Cythonizing pomegranate/kmeans.pyx
      [ 9/28] Cythonizing pomegranate/utils.pyx
      Traceback (most recent call last):
        File "/Users/miw267/Repos/changepoints/deactivate/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/Users/miw267/Repos/changepoints/deactivate/lib/python3.11/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/miw267/Repos/changepoints/deactivate/lib/python3.11/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/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/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/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "/private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 61, in <module>
        File "/private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1115, in cythonize
          cythonize_one(*args)
        File "/private/var/folders/vg/q45k1lj96hzd0qyfkwstbqbr0000gq/T/pip-build-env-fgw3yhvh/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1238, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: pomegranate/utils.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.
@tiwalayo
Copy link

tiwalayo commented Jul 6, 2024

I have the same issue on x86_64.

@tiwalayo
Copy link

tiwalayo commented Jul 6, 2024

You may have fixed this but I'll post here for posterity. See jmschrei/pomegranate#1052, jmschrei/pomegranate#1057 for more information about what's going on here.

Long story short is that cnvkit asks for pomegranate 0.14.8 or 0.14.9, but those versions of pomegranate ask for numpy versions >=1.20.0. The issue here is that the numpy 2.0.0 release is not backwards compatible, so when you install, it tries to use the most recent (but incompatible) version, causing the error you posted.

The fix in jmschrei/pomegranate#1052 hasn't been pushed. If it ever does get pushed/released, there may still be problems if they release it under 0.14.10 since cnvkit asks for pomegranate >= 0.14.8, <=0.14.9.

The fastest fix is to download a version of pomegranate labelled as release 0.14.9 that asks for numpy <2.0.0. This repo I made does precisely that. I was able to install cnvkit by making sure I downloaded old versions of the problematic dependencies (cython, numpy) and then the "new" pomegranate.

Try doing

pip uninstall cython numpy -y
pip install cython==0.29.17 numpy==1.26.4 -y
git clone -b v0.14.9 --single-branch https://github.com/tiwalayo/pomegranate.git
pip install -e pomegranate/

@ProfH2SO4
Copy link

Thank you tiwalayo It works like a charm. You saved me a lot of time. Thank you! :)

@Stikus
Copy link

Stikus commented Aug 29, 2024

@tiwalayo Thx for patched version of pomegranate. Btw - pomegranate 1.15.0 finally released - so it can be used in cnvkit requirements.

FYI - you can install your version in one-liner: pip3 install git+https://github.com/tiwalayo/pomegranate@v0.14.9

@etal We deeply need patch for cnvkit requirements - currently it asks pomegranate >= 0.14.8, <=0.14.9, you can switch to pomegranate >= 0.14.8, <=0.15.0 or maybe better pomegranate >= 0.14.8, <1.0.0 for future legacy problems.

@etal
Copy link
Owner

etal commented Sep 4, 2024

Thanks for the guidance. I can update the CNVkit requirements to use pomegranate >= 0.14.8, <1.0.0 in the short term.

The longer-term fix of using pomegranate 1.x is a bit more involved. WIP here, help would be welcome: #910

@etal
Copy link
Owner

etal commented Sep 4, 2024

Fixed here: #911

Does installation work for you now?

@Stikus
Copy link

Stikus commented Sep 4, 2024

@etal Will you create new tag or update current 0.9.11?

@Stikus
Copy link

Stikus commented Oct 1, 2024

@etal Hello again. What about new tag?

@serge2016
Copy link

Dear @etal could you tag/create a new release with this fix, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants