ViennaRNA / forgi

An RNA manipulation library.
GNU General Public License v3.0
51 stars 30 forks source link

pip install fails #45

Closed swingingsimian closed 1 year ago

swingingsimian commented 1 year ago

Issue description

pip (v22.2.2) install fails on Ubuntu focal 20.04, numpy not found.

Steps to reproduce the issue

  1. pip install forgi

What's the expected result?

The forgi package and it's dependencies are installed successfully.

What's the actual result?

$ pip install --upgrade forgi
Collecting forgi
  Using cached forgi-2.1.2.tar.gz (26.8 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [9 lines of output]
      fatal: not a git repository (or any of the parent directories): .git
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-ozdinv26/forgi_2251004d8f404f19a4d5e453461d8c4d/setup.py", line 88, in <module>
          "ext_modules": try_cythonize("forgi/threedee/utilities/cytvec"),
        File "/tmp/pip-install-ozdinv26/forgi_2251004d8f404f19a4d5e453461d8c4d/setup.py", line 17, in try_cythonize
          import numpy
      ModuleNotFoundError: No module named 'numpy'
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.
Bernhard10 commented 1 year ago

Forgi requires numpy and cython for building and installing. This is the workaround for the current version.

Reason: When the setup.py was originally written, it was difficult to create a setup.py file that properly installs cython and numpy before compiling the cython extensiuon. See: https://stackoverflow.com/questions/37471313/setup-requires-with-cython

I will also change the setup.py to use the Extension directly (which works since setuptools >= 18), which will solve this issue

Bernhard10 commented 1 year ago

With version 2.2.2 I made further improvements to setup.py, so it should now install on most platforms without problems