0

I have stated numpy==1.25.1 in my requirements.txt file and it is getting installed as well while deploying my app.

'''Collecting numpy==1.25.1

Downloading numpy-1.25.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.7 MB)

 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.7/17.7 MB 225.3 MB/s eta 0:00:00[2023-07-21 06:37:21.081699'''

But while trying to install lap==0.4.0, it is giving me the following error

'''Building wheel for lap (setup.py): started

Building wheel for lap (setup.py): finished with status 'error'

error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.

│ exit code: 1

╰─> [13 lines of output]

  Partial import of lap during the build process.

  Traceback (most recent call last):

    File "/tmp/pip-install-8tneoahv/lap_ffe670863c2c44caa4f276a3a0edfa0e/setup.py", line 127, in get_numpy_status

      import numpy

  ModuleNotFoundError: No module named 'numpy'

  Traceback (most recent call last):

    File "<string>", line 2, in <module>

    File "<pip-setuptools-caller>", line 34, in <module>

    File "/tmp/pip-install-8tneoahv/lap_ffe670863c2c44caa4f276a3a0edfa0e/setup.py", line 236, in <module>

      setup_package()

    File "/tmp/pip-install-8tneoahv/lap_ffe670863c2c44caa4f276a3a0edfa0e/setup.py", line 220, in setup_package

      raise ImportError('lap requires numpy, '

  ImportError: lap requires numpy, please "pip install numpy".'''

I tried multiple versions of numpy but no solution as of now

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36

2 Answers2

0

Looks like there is an existing issue for it on the lap GitHub.

https://github.com/gatagat/lap/issues/48

There seems to be a few work arounds from what I am reading.

SomeSimpleton
  • 350
  • 1
  • 2
  • 12
0

Try to upgrade pip first and then reinstall:

python -m pip install --upgrade pip
python -m pip install lap

If this does not work, remove numpy and install lap first:

python -m pip uninstall numpy
python -m pip install lap

sources: here and here.

matleg
  • 618
  • 4
  • 11
  • It is running perfectly fine locally, but while trying to deploy it in streamlit, i am facing the error. To deploy I need to provide the requirements.txt file, how shall i make the changes over there ? – Sandip Shaw Jul 21 '23 at 07:24
  • You'll probably have to check all the differences in versions between your local and remote : OS, python, pip, and requirements, to ensure that everything is compatible. – matleg Jul 21 '23 at 07:29
  • I used the command ''' pip freeze > requirements.txt ''' in order to generate the requirements.txt file, which is uploaded in github and used for the deployment. is there any thing i am doing it wrong ? – Sandip Shaw Jul 22 '23 at 07:07