0

I want to install a package in PyCharm and it cant be installed, so instead I install in the CMD in Windows with the same Python version that I set as interpreter in PyCharm. Now, when I want to import the package from inside PyCharm, it doesn't work but importing it from the Windows terminal works fine.

How can I connect the installed packages of python from the CMD to PyCharm ?

David Buck
  • 3,752
  • 35
  • 31
  • 35
Esalah
  • 27
  • 1
  • 5
  • [Make sure your PyCharm is using exactly the same interpreter that you're running in your terminal.](https://www.jetbrains.com/help/pycharm/configuring-python-interpreter.html) If it is, then the packages will be the same. – AKX Feb 11 '22 at 15:37
  • By the way, "I want to install a package in PyCharm and it cant be installed" won't help us help you much - "I'm trying to install the package XYZFOO and I get this error in PyCharm: ...." would be a _lot_ better. – AKX Feb 11 '22 at 15:38

2 Answers2

0

Use "Add Interpreter" button that can be found at bottom left corner of your editor. In System Interpreter tab, Select or enter your python interpreter location (exe file). Make sure that Pycharm is not using a virtual environment. This will make Pycharm use your default installation of python that runs in your cmd, this means that your installed packages will be usable in Pycharm.

Erfan Saberi
  • 134
  • 8
0

Please go to Preferences > Project > Project Interpreter > Choose your project and the current Python Interpreter, then you'll see the packages below. If this is empty, click on the + sign and install the relevant packages.

Tomer Aharon
  • 57
  • 10