streamlit version: 1.41.1
OS: archlinux
(running on local machine)
Summary:
Streamlit uses my archlinux python-numpy-2.2.1-2 despite running out a venv with numpy 1.23.1 version installed.
More details:
Due to some dependency issues between numpy, bokeh and the python version itself, I need to run
python 3.10.16
bokeh 2.4.3
numpy 1.23.1
I tried setting this up using pyenv and pipenv and alternatively uv , to the same result.
If I activate the venv and run streamlit, it uses the python 3.10.16 version BUT still uses my system’s numpy 2.2.1 , which is not compatible with the rest of the setup.
I would appriciate any tips on howto resolve this issue.
this is also irritating me, but here is a log (I redacted some user paths):
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://10.133.8.24:8501
2025-01-17 10:36:26.890 Uncaught app execution
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/numpy/_core/__init__.py", line 23, in <module>
from . import multiarray
File "/usr/lib/python3.13/site-packages/numpy/_core/multiarray.py", line 10, in <module>
from . import overrides
File "/usr/lib/python3.13/site-packages/numpy/_core/overrides.py", line 7, in <module>
from numpy._core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy._core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.13/site-packages/numpy/__init__.py", line 114, in <module>
from numpy.__config__ import show_config
File "/usr/lib/python3.13/site-packages/numpy/__config__.py", line 4, in <module>
from numpy._core._multiarray_umath import (
File "/usr/lib/python3.13/site-packages/numpy/_core/__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.10 from "<redacted>/.venv/bin/python3"
* The NumPy version is: "2.2.1"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy._core._multiarray_umath'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<redacted>/.venv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/exec_code.py", line 88, in exec_func_with_error_handling
result = func()
File "<redacted>/.venv/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 579, in code_to_exec
exec(code, module.__dict__)
File "<redacted>/display.py", line 2, in <module>
import numpy as np
File "/usr/lib/python3.13/site-packages/numpy/__init__.py", line 119, in <module>
raise ImportError(msg) from e
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python interpreter from there.
There might be a PATH misconfiguration or something that is prioritizing a global installation. Can you uninstall numpy from your global environment and then try again to create a clean environement and install numpy there?
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.