SystemError encountered for app that has been working for months due to Numpy Numba dependency issue

Hi, 2 of my apps suddenly stopped working, even though they have been working for the previous few months. This is the error

SystemError: initialization of _internal failed without raising an exception

From this link and this link and this link, it appears that it is because of a dependency issue with numpy and numba.

It appears that one needs to reinstall numba, which will then install the right version of numpy. But how do I do that when deploying onto the cloud?

I also tried manually editing my requirements.txt to the correct versions (numpy==1.23.1, numba==0.56.4) but it still shows, which indicates the incorrect versions are installed:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
numba 0.56.4 requires numpy<1.24,>=1.18, but you have numpy 1.24.3 which is incompatible.
Successfully installed MarkupSafe-2.1.2 altair-4.2.2 attrs-23.1.0 entrypoints-0.4 jinja2-3.1.2 jsonschema-4.17.3 numpy-1.24.3 pandas-2.0.1 pyrsistent-0.19.3 python-dateutil-2.8.2 pytz-2023.3 six-1.16.0 toolz-0.12.0 tzdata-2023.3

I am able to run the app on my local windows device though. So the problem appears to be specific for the linux environment when deploying to streamlit cloud.

Please help!

Can you share your requirements.txt file that you are using?

Here is the requirements.txt for 1 of my project. The other one is way longer so sharing this instead.

scikit-learn==1.0.2
pandas==1.3.5
shap==0.41.0
matplotlib==3.5.1
pydeck==0.7.1
streamlit==1.11.1
joblib==1.1.0
requests==2.27.1
geopy==2.2.0
numba==0.56.4
numpy==1.23.1
gdown

This is for the other project. Apologies for the long list.

absl-py==1.2.0
altair==4.2.0
appdirs==1.4.4
asttokens==2.0.8
astunparse==1.6.3
attrs==22.1.0
audioread==3.0.0
backcall==0.2.0
black==22.10.0
blinker==1.5
cachetools==5.2.0
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
click==8.1.3
colorama==0.4.5
coloredlogs==15.0.1
commonmark==0.9.1
contourpy==1.0.5
cycler==0.11.0
debugpy==1.6.3
decorator==5.1.1
entrypoints==0.4
executing==1.1.1
ffmpeg==1.4
flatbuffers==22.9.24
fonttools==4.37.4
future==0.18.2
gast==0.4.0
gitdb==4.0.9
GitPython==3.1.29
google-auth==2.12.0
google-auth-oauthlib==0.4.6
google-pasta==0.2.0
grpcio==1.49.1
h5py==3.7.0
humanfriendly==10.0
idna==3.4
importlib-metadata==5.0.0
imutils==0.5.4
ipykernel==6.16.0
ipython==8.5.0
jedi==0.18.1
Jinja2==3.1.2
joblib==1.2.0
jsonschema==4.16.0
jupyter-core==4.11.1
jupyter_client==7.4.2
keras==2.10.0
Keras-Preprocessing==1.1.2
kiwisolver==1.4.4
libclang==14.0.6
librosa==0.9.2
llvmlite==0.39.1
loguru==0.6.0
Markdown==3.4.1
MarkupSafe==2.1.1
matplotlib==3.6.0
matplotlib-inline==0.1.6
mpmath==1.2.1
mypy-extensions==0.4.3
nest-asyncio==1.5.6
ninja==1.10.2.4
numba==0.56.3
numpy==1.23.3
oauthlib==3.2.1
onnx==1.12.0
onnxruntime==1.12.1
opencv-python==4.6.0.66
opt-einsum==3.3.0
packaging==21.3
pafy==0.5.5
pandas==1.5.0
parso==0.8.3
pathspec==0.10.1
pickleshare==0.7.5
pilgram==1.2.1
Pillow==9.2.0
platformdirs==2.5.2
pooch==1.6.0
prompt-toolkit==3.0.31
protobuf==3.19.6
psutil==5.9.2
pure-eval==0.2.2
pyarrow==9.0.0
pyasn1==0.4.8
pyasn1-modules==0.2.8
pycocotools==2.0.5
pycparser==2.21
pydeck==0.8.0b4
pydub==0.25.1
pyee==9.0.4
Pygments==2.13.0
Pympler==1.0.1
pyparsing==3.0.9
pyreadline3==3.4.1
pyrsistent==0.18.1
python-dateutil==2.8.2
pytz==2022.4
pytz-deprecation-shim==0.1.0.post0
pyzmq==24.0.1
requests==2.28.1
requests-oauthlib==1.3.1
resampy==0.4.2
rich==12.6.0
rsa==4.9
scikit-learn==1.1.2
scipy==1.9.2
semver==2.13.0
six==1.16.0
smmap==5.0.0
soundfile==0.11.0
stack-data==0.5.1
streamlit==1.13.0
sympy==1.11.1
tabulate==0.9.0
tenacity==8.1.0
tensorboard==2.10.1
tensorboard-data-server==0.6.1
tensorboard-plugin-wit==1.8.1
tensorflow-estimator==2.10.0
tensorflow-hub==0.12.0
tensorflow-io-gcs-filesystem==0.27.0
termcolor==2.0.1
thop==0.1.1.post2209072238
threadpoolctl==3.1.0
toml==0.10.2
tomli==2.0.1
toolz==0.12.0
torch==1.12.1
torchvision==0.13.1
tornado==6.2
tqdm==4.64.1
traitlets==5.4.0
typing_extensions==4.3.0
tzdata==2022.5
tzlocal==4.2
urllib3==1.26.12
validators==0.20.0
watchdog==2.1.9
wcwidth==0.2.5
Werkzeug==2.2.2
win32-setctime==1.1.0
wrapt==1.14.1
youtube-dl==2021.12.17
zipp==3.9.0

  • Please share your github repo links
  • You probably don’t need most of the packages, clean it up
  • You also have windows-only packages, which will not run on streamlit cloud

Here are the github repo links:

Thanks for the advice on cleaning up the required packages. Will do so!

I got it to work.

  1. Deleted my virtual environment and created a new one.
  2. Updated streamlit package to latest.
  3. Installed only necessary packages for app to work.

That solves the issue. Not sure what was the problem though. Might be a clash in dependencies of some of the packages.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.