ModuleNotFoundError for many installed files - now resolved

I was having a ModuleNotFoundError for many import statements.  I could see that the files were in the "site-packages" directory and pip install said, "Requirement already satisfied".

I am using PyCharmCE2021.2 on Windows 10.

I found the answer I was looking for under the menu option File > Settings...  In the dialog box, look for "Project:" <your project name>.  Click the ">" to the left to expand choices under "Project:".  Choose "Project Structure".  The right panel shows a file tree.  You are looking for the "site-packages" directory.  On my system, it is located in "E:\PyCharmProjects\<project_name>\venv\Lib\site-packages\".  (If you are using a virtual environment, you will have a "venv" directory also.) When you find the "site-packages" directory you can right-click and choose "Sources" or you could left-click to highlight it and then choose the "Sources" button at the top.  Next, at the bottom of the dialog box choose the "Apply" button.  And finally, choose the "OK" button.

I hope you will now be getting all of the best "import"s from around the world!

Please sign in to leave a comment.