Pip Installs successfully, but when importing to program the module cannot be found (Pycharm). How do I fix this?

Question:

I have been having this issue with all my modules and as a beginner its frustrating. I downloaded beautiful soup using: pip install bs4 and it was successful. When I then try to import the module into my program it says No module named ‘bs4’. My beautifulsoup files are located in site-packages so they are installed.

Ive had problems with this issue with any module I install like tkinter.

I tried moving the files from site-packages to Lib but it still doesn’t work, I might just uninstall and reinstall because it might be too messed up now.

Asked By: teehigs

||

Answers:

PyCharm creates an virtual-environment for your project, so you have to run the pip command inside of this environment.

Answered By: lkrimphove