ModuleNotFoundError: No module named 'pytrends', even though it is installed in the environment

I am developing an app using pytrends library. it’s installed in the environment. but when streamlit is run, it shows no module found

Could you make sure you’re also running streamlit that is installed in the environment? The reason I ask is it’s possible to have a globally-installed streamlit, and if you run that one, it may not be able to use your local packages.

You can check with which streamlit

If it’s not running the streamlit from your environment, you can try doing python -m streamlit run whatever.py to make sure it’s running the correct one (assuming which python shows the python in your environment).