Streamlit does not use venv

Hey everyone,

I am having trouble to make Streamlit use my virtual environment, it insists on using the global environment.
Here is my list of processes:

  • Create a new folder.
  • Open the folder using vscode.
  • python -m venv env
  • Activate the env
  • Install packages such as streamlit and additional package called pyeq3. (Note that pyeq3 is not installed in my global package, but others are.)
  • In the terminal of vscode where env is already activated, write “streamlit run”.
  • Streamlit says pyeq3 is not installed and the error message refers to that is located inside my global environment. So it does not look into my virtual environment.

Can anyone see what I am doing wrong here?

Hi @Berk_Demir -

I use conda instead of venv, but I’ve had issues like this before. One thing that can be messy about VSCode is that the editor can be in one environment, but the terminal is pointing to another:

Here, the VSCode editor is pointing to attractors, and the terminal is pointed to metricsdash. So depending on where you are trying to point to, you can get weird things happening.


In your case, I would expect metricdash to start streamlit. However, that’s not working for me.

You can see that my VSCode uses same environment both in terminal and VSCode. However, even though this venv has the pyeq3 module I use, streamlit cannot find it.

@Marc, based on your perfect awesome-streamlit guideline for VSCode, would you help the case?