Numpy Error

ERROR: Could not find a version that satisfies the requirement numpy==1.22.2 (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0rc1, 1.17.0rc2, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0rc1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0rc1, 1.19.0rc2, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0rc1, 1.20.0rc2, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0rc1, 1.21.0rc2, 1.21.0, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5)
ERROR: No matching distribution found for numpy==1.22.2

I get this error but the latest version of numpy is 1.22.2

1 Like

Hi @Victor_Umunna, welcome to the community!! :wave: :partying_face:

The error message from pip in this case isn’t very instructive. The cause of the error can be found by looking at all the downloadable wheel files for numpy==1.22.2 on PyPI.

You’ll notice that the files are built for Python 3.8, 3.9, and 3.10. The default installation of Python on Streamlit Cloud is version 3.7.

Solution

  1. Delete your app on Streamlit Cloud
  2. Click on “New app” from the app dashboard
  3. Enter the GitHub URL of your app
  4. Click on “Advanced settings…”
  5. Select Python 3.8 from the drop down and click “Save”
  6. Once you deploy your app with Python 3.8, you should see a successful install of numpy==1.22.2 in your Cloud logs.

Happy Streamlit-ing! :balloon:
Snehan

Thanks, Snehan. It worked but i got another error

from lightgbm import LGBMRegressor
ModuleNotFoundError: No module named ‘lightgbm’

I have installed lightgbm onvscode and jupyter noteboook but i get this same error.

I would encourage you to go through our Get started guide for Streamlit Cloud. You are likely missing a requirements.txt file in your GitHub repo that should contain your Python dependencies, including lightgbm.

Best,
Snehan

Hi @Victor_Umunna , my issue has been solved with this environment.yml:

channels:

  • conda-forge

dependencies:

  • yfinance
  • plotly
  • ephem
  • pystan
  • fbprophet
  • pip
  • pip:
    • streamlit
  • List item

Hi Snehan,
I have the same problem. I have numpy in my anaconda 1.21.5. My pandas version 3.7.13 but receive this error message module numpy. I use pandas to open dataframe and use if-statement. I didnt use numpy. In my py files, without import numpy, all files works before deployment. Thus, I dont have to import numpy in my py file. So I am not sure why it keeps on mention about no numpy.

I deleted the app and re-create under python 3.8 as shown by you. But still has the same error.

Error:
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File “”, line 2, in
File “”, line 34, in
File “/tmp/pip-install-jy1mxljv/lttbc_dcd2980ca7b74f73ae3972d7cc525e3b/setup.py”, line 7, in
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.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I get this error in google colab and i don’t know how to solve it

ERROR: Could not find a version that satisfies the requirement numpy==1.22.0 (from versions: 1.3.0, 1.4.1, 1.5.0, 1.5.1, 1.6.0, 1.6.1, 1.6.2, 1.7.0, 1.7.1, 1.7.2, 1.8.0, 1.8.1, 1.8.2, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0.post2, 1.10.1, 1.10.2, 1.10.4, 1.11.0, 1.11.1, 1.11.2, 1.11.3, 1.12.0, 1.12.1, 1.13.0rc1, 1.13.0rc2, 1.13.0, 1.13.1, 1.13.3, 1.14.0rc1, 1.14.0, 1.14.1, 1.14.2, 1.14.3, 1.14.4, 1.14.5, 1.14.6, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0rc1, 1.17.0rc2, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0rc1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0rc1, 1.19.0rc2, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0rc1, 1.20.0rc2, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0rc1, 1.21.0rc2, 1.21.0, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6)
ERROR: No matching distribution found for numpy==1.22.0

Hi @Victor_Umunna,

Thanks for posting!

Can you share your requirements.txt file?

Caroline :balloon: