Pycharm Cann't Find The Packages Or Modules Installed With Pip On Windows
Solution 1:
The thing is that pycharm creates all of your projects inside a virtual environment. So the packages that you installed outside the virtual environment(global site packages) does not get inherited in to your project. There is a simple solution for that. When you create a pycharm project, make sure to check the "inherit global-site packages" checkbox as shown here.Then you'll be able to import all the packages to your virtual environment, provided they have been installed in your computer.
Alternatively you can install all the packages separately using "pip install" in the pycharm terminal. If the package has been installed outside the virtual environment, pip will use cached files instead of downloading the package again.
Or you can install the packages using Settings -> Project -> Project Interpreter as the other answers suggests.
Solution 2:
Seems like the interpreter selected isn't where you think it is. If you're using a different interpreter than the system's default, it won't load the modules. To add the modules in PyCharm, go to your Settings, Project Interpreter, the Add Button, and install it with PyCharm's integrated package management.
Solution 3:
In PyCharm, go to File / Default Settings / Project Interpreter
On that page there is a plus in the bottom left, whatever modules you have installed through pip you may need to manually install there. Or you can change your project interpreter to make sure you are using the correct interpreter with all your installed modules.
Solution 4:
If you did not "inherit global-site packages" upon creating the project, check in the project tree under External Libaries, if the folder is marked in red. I.e. if you do not use the systems default interpreter , Lib/site-packages could be marked in red. To add those libraries afterwards, go to: File-Project(your project)\Project Structure, select +Add Content Root, browse to site-packages (or the respective folder you want to add), and add it. After clicking OK the folder will not be marked red any longer. (tested in PyCharm 2020.3)
Post a Comment for "Pycharm Cann't Find The Packages Or Modules Installed With Pip On Windows"