I consistently getting the following attempting to deploy my app to Streamlit cloud. Essentially the installation of Riskfolio-Lib cannot find the installed numpy.
I have managed to get it working once but it still comes back to this problem.
Collecting numpy==1.23.5
Downloading numpy-1.23.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.1/17.1 MB 223.2 MB/s eta 0:00:00[2023-02-25 14:02:25.454561]
…
Collecting Riskfolio-Lib
Downloading Riskfolio-Lib-4.0.3.tar.gz (12.9 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.9/12.9 MB 130.2 MB/s eta 0:00:00[2023-02-25 14:02:28.806161]
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'error'
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [6 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/tmp/pip-install-fnma2v77/riskfolio-lib_1328a963259a48cea2f755a2a71c78d3/setup.py", line 4, in <module>
import numpy as np
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.
Below are my dependencies. I have included all that are needed as specified in Riskfolio-Lib · PyPI and have specified the versions running on my local IDE.
numpy==1.23.5
scipy==1.9.3
pandas==1.4.4
matplotlib==3.6.2
cvxpy==1.3.0
statsmodels==0.13.2
arch==5.3.1
networkx==2.8.4
astropy==5.1
pybind11==2.10.3
streamlit==1.18.1
stockstats==0.5.2
openpyxl==3.0.10
yfinance==0.1.72
Riskfolio-Lib
The repository is at phat-ap/quant_tools (github.com) and the app is Efficient_Frontier_SET.py