- I want to run a Streamlit app within a virtual environment.
- I have installed Streamlit for the base Python interpreter, and then create a new virtual environment like:
virtualenv someEnv --system-site-packages
- Expectation is that packages installed for the base interpreter are available in
someEnv
- Some specific software is required in the virtual env, but can’t be on the base interpreter. We activate
someEnv
and install the necessary packages likepip install somePackage
.somePackage
is used by the Streamlit app. - Executing
streamlit run
withsomeEnv
activated produces aModule not found
error forsomePackage
. - I can verify some package is installed by opening an interpreter and importing
somePackage
- Installing Streamlit in
someEnv
while it is installed for the base interpreter produces no change. - Uninstalling Streamlit for the base interpreter and then re-installing in
someEnv
allows the app to run and findsomePackage
correctly.
Is this expected behaviour?
Why would using a system-installed version of Streamlit in a virtual environment prevent the app from finding packages installed in a virtual environment if that virtual environment also has access to system site packages?
Any guidance would be much appreciated!