Search code examples
pythoncmdpycharm

Why do I need reinstall python packages in PyCharm even I have already installed needed packages in Windows CMD?


I have installed some python packages in Windows CMD or Windows PowerShell using pip install and the installed files could be found in site-packages directory, which works in python IDLE. However, when I use PyCharm to import the packages, it shows I need to install the packages again. So why is it the case?

I installed the packages in CMD and PowerShell, it doesn't works. It works when I install it in Terminal operation in PyCharm. I hope to learn some mechanism behind this problem.


Solution

  • Copying my comment to an answer:

    If you're new to PyCharm, note it offers you to start new projects in a virtual environment (venv) - which doesn't have the installed libraries because it's better to only install those you need for your project. In the PyCharm Interpreter settings for your project you can change this and use the global python with all libraries. This is not recommended, because if you want to run your program on a different computer, it may fail and you then don't know what to install.