Streamlit-extras import issue

Streamlit-extras are being imported from another environment

I am using Conda environment (python - 3.10.9). And every import is coming from that environment’s path except streamlit-extras. I already installed streamlit-extras on this environment and double checked whether it is there.
But when I import, it is looking another path (python - 3.7) and therefore giving ModuleNotFound Error.

Code snippet:

from streamlit_extras.let_it_rain import rain

If applicable, please provide the steps we should take to reproduce the error or specified behavior.

Expected behavior:

Rain Emoji

Actual behavior:
ModuleNotFoundError: No module named ‘streamlit_extras.let_it_rain’

Traceback:

File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)File "/Users/abduraimovusmanjon/Desktop/danger/pages/1_🎢_Insights.py", line 16, in <module>
    from streamlit_extras.let_it_rain import rain

Debug info

Requirements file

Using Conda? PipEnv? PyEnv? Pex? Share the contents of your requirements file here.
Not sure what a requirements file is? Check out this doc and add a requirements file to your app.

Links

  • Link to your GitHub repo:
  • Link to your deployed app:

Could you do which streamlit to see if it’s running the streamlit installed in your conda environment?

1 Like

Yeah I did @blackary , and it is indeed showing 3.7 python path. /Library/Frameworks/Python.framework/Versions/3.7/bin/streamlit

Sorry but do you have any idea how to change it, I am really new:)

@Usmanjon_Abduraimov One thing to try is deactivating your conda environment, and then re-activating it, and seeing if which streamlit shows the one installed in your environment.

If that doesn’t work, you can do python -m streamlit run ... instead of streamlit run ... to make sure that you are running the streamlit that is associated with your current python.

Also, just to make sure – did you already install streamlit in the conda environment? That could also be the problem.

1 Like

Thank you much bro again! @blackary . I am working on it!!

1 Like

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