This is guide for installing the pip packages from Python Console in Pycharm IDE.

Do not forget to run Pycharm as administrator if you are using windows OS before installing the packages.

First of all import the pacakage of pip in python console.

import pip

Installation of Package.

 pip.main(['install', '<package_name>'])

Examples
The below command will upgrade the version of package setuptools.

pip.main(['install','--upgrade','setuptools'])

The below command will install the scikit-learn and numpy packages.

pip.main(['install','numpy','scikit-learn'])

The below command will uninstall the scikit-learn package.

pip.main(['uninstall','scikit-learn'])

Answer from Zahid on Stack Overflow
🌐
TMS Outsource
tms-outsource.com › home › how to install pip in pycharm explained
How to Install Pip in PyCharm Explained
December 21, 2025 - Open the Terminal tool window with the project interpreter active and run python -m ensurepip –upgrade. If that fails, download get-pip.py from bootstrap.pypa.io and run python get-pip.py instead.
Discussions

I tried to do a pip install in a Pycharm IDE it won't let me.
So it gave you an error. It tried to tell you what was wrong. Don't you think it would be useful to tell everyone else what the error is? More on reddit.com
🌐 r/learnpython
7
1
September 23, 2022
python - Installing pip in Pycharm 2016.3 - Stack Overflow
I upgraded to the new version of Pycharm. In the terminal, it says bash-3.2$ instead of my username. When I tried to install a library, it said that pip command is not found: bash: pip: command not More on stackoverflow.com
🌐 stackoverflow.com
September 16, 2018
Install PyCharm and pip - Python Help - Discussions on Python.org
Hi all. I’m getting ready to install PyCharm. I’ve been using vanilla python and IDLE for a while now and I kinda want to level up. If you’re in cmd line in WIN and you set the “pip config set global.require-virtualenv true”, does this mean you have to set this to false when using PyCharm? More on discuss.python.org
🌐 discuss.python.org
0
May 15, 2023
What's best practice when using an IDE like PyCharm, pip install via terminal or use PyCharm's built in package installer. I'm experiencing some confusing behaviour when I compare the two methods.
Pycharm uses something called virtual environments by default. It creates a folder specific to the project, that has the modules installed there instead of the system python. That is considered good practice because different python projects tend to need different packages at different versions. If you have one script that needs requests version 1.3 and breaks if you run it with any other version, what are you going to do if another script needs version 1.4 and breaks with any other version? Python can't handle two different version packages with the same name, you don't have a way to select which one you want when you do "import requests". So virtual environments help with that, each project sees their own packages, but then to run it from outside you need to run the python inside the proper virtual environment, not the system python. https://realpython.com/python-virtual-environments-a-primer/ More on reddit.com
🌐 r/learnpython
10
5
January 6, 2023
🌐
YouTube
youtube.com › watch
How to Install pip in PyCharm | Step-by-Step Tutorial - YouTube
How to Install pip in PyCharm | Step-by-Step TutorialIn this quick tutorial, I’ll show you how to install pip, the Python package manager, right inside PyCha...
Published: April 20, 2025
🌐
JetBrains
jetbrains.com › help › pycharm › installing-uninstalling-and-upgrading-packages.html
Install, uninstall, and upgrade packages | PyCharm Documentation
August 17, 2026 - PyCharm provides methods for installing, uninstalling, and upgrading Python packages for a particular Python interpreter. It means that each project has its own set of packages, which is considered a best practice for Python dependency management. By default, PyCharm uses pip to manage project packages.
🌐
YouTube
youtube.com › watch
Pycharm PIP Install | How to Install Python PIP Packages in Pycharm - YouTube
Let's get started. In this Pycharm PIP install video, we will learn how to identify the PIP version that PyCharm is currently running on as well as how to in...
Published: July 20, 2022
🌐
YouTube
youtube.com › watch
How to Install Pip packages using PyCharm ? | How to Install Python PIP Packages in PyCharm - YouTube
#kkjavatutorials #pycharm #pythonAbout this Video:This video talks about How to Install Pip packages using PyCharm ? Follow me on Social network:Facebook: ht...
Published: January 25, 2021
🌐
YouTube
youtube.com › programmingknowledge2
How to Install Python PIP Packages On PyCharm - YouTube
### How to Install Python PIP Packages On PyCharmInstalling Python packages in PyCharm is straightforward, thanks to its built-in package management system. ...
Published: July 2, 2024
Views: 2K
Find elsewhere
🌐
YouTube
youtube.com › watch
How to Install Python PIP Packages in PyCharm - YouTube
In this Python video I am going to show you How to Install Pip packages using PyCharm or How to use PyCharm for installing and managing Pip and PyPI (Python...
Published: October 22, 2018
🌐
YouTube
youtube.com › programmingknowledge2
How To Install Python Libraries In PyCharm - YouTube
In this tutorial, you will learn how to install Python libraries in PyCharm, a powerful integrated development environment (IDE) for Python development. Pyth...
Published: July 22, 2023
Views: 51K
🌐
JetBrains
jetbrains.com › guide › python › tutorials › getting-started-pycharm › installing-and-managing-python-packages
Installing and Managing Python Packages - JetBrains Guide
March 30, 2023 - You just saw how easy it is to install and manage Python packages in PyCharm. Another quick tip is that sometimes people install Python packages from the local terminal without having the virtual environment activated. In this case, when you import the package using PyCharm, you will see a red squiggly line and an error saying ‘No module named requests’, for example.
🌐
TMS Outsource
tms-outsource.com › home › how to install packages in pycharm quickly
How to Install Packages in PyCharm Quickly
June 22, 2026 - Choose this when you need to install from a requirements.txt file or custom repository. The integrated terminal runs pip commands directly within PyCharm, giving you the same control as a standalone command line while staying inside the IDE.
🌐
Python.org
discuss.python.org › python help
Install PyCharm and pip - Python Help - Discussions on Python.org
May 15, 2023 - Hi all. I’m getting ready to install PyCharm. I’ve been using vanilla python and IDLE for a while now and I kinda want to level up. If you’re in cmd line in WIN and you set the “pip config set global.require-virtualenv …
🌐
JetBrains
jetbrains.com › help › pycharm › package-installation-issues.html
Package installation issues | PyCharm Documentation
November 28, 2025 - Eventually, most of the issues are out of IDE control as PyCharm uses the pip package manager to perform the actual installation. This article provides troubleshooting tips and covers some typical cases. The most viable troubleshooting action is to try installing the problematic package on the selected Python interpreter using the terminal...
🌐
YouTube
youtube.com › watch
Installing and managing Python packages in PyCharm | Getting started - YouTube
This is the Getting Started Series, with Paul Everitt.In this episode, you will learn how to create install and manage Python packages in PyCharm.0:00 - Intr...
Published: April 5, 2022
🌐
Quora
quora.com › What-is-the-command-to-install-a-package-in-PyCharm-like-Jupyter-Notebooks-has-Pip-install-numpy
What is the command to install a package in PyCharm like Jupyter Notebooks has “! Pip install numpy”? - Quora
1. 1 type ‘pip install numpy’ into the terminal within Pycharm - not the python console 2. 2 you can do an ‘import numpy’ in your python code, and when python does the red squggle under that line it will prompt you to install and import 3. 3 if you are using setupto...
🌐
Reddit
reddit.com › r/learnpython › what's best practice when using an ide like pycharm, pip install via terminal or use pycharm's built in package installer. i'm experiencing some confusing behaviour when i compare the two methods.
r/learnpython on Reddit: What's best practice when using an IDE like PyCharm, pip install via terminal or use PyCharm's built in package installer. I'm experiencing some confusing behaviour when I compare the two methods.
January 6, 2023 -

I pip installed from CMD a python package "pip install example" and it installs to "site-packages" folder where python 3.11 is installed to.

That works and my code in pycharm runs.

Then I uninstalled in cmd using command "pip uninstall example" and reinstalled the package from within pycharm's package installer window (hit the + button, search package click install). First thing I noticed is I can't find where the package was installed to in my computer.

After that if I click run, everything works, but I can no longer run that script from the terminal as it says the package is not installed.

From now on then, should I completely ignore pycharm package install functionality and just install packages via pip from the terminal either in pycharm or CMD? Is this the done thing?

Edit: After deleting my test project to see if the below works, it doesn't! My new pycharm test project is pointing at my python install, where example package is still installed, but clicking the run button (or shift f10) yields the "no module named 'example' error. But it will run from the terminal. Please help!

I'm thinking that if I pip install via the terminal from now on, those packages will always be available so long as I point pycharm to where python is installed on my computer when creating a new project.

Thanks for reading, any advice here would be greatly appreciated.

Top answer
1 of 3
5
Pycharm uses something called virtual environments by default. It creates a folder specific to the project, that has the modules installed there instead of the system python. That is considered good practice because different python projects tend to need different packages at different versions. If you have one script that needs requests version 1.3 and breaks if you run it with any other version, what are you going to do if another script needs version 1.4 and breaks with any other version? Python can't handle two different version packages with the same name, you don't have a way to select which one you want when you do "import requests". So virtual environments help with that, each project sees their own packages, but then to run it from outside you need to run the python inside the proper virtual environment, not the system python. https://realpython.com/python-virtual-environments-a-primer/
2 of 3
2
PyCharm typically uses a virtual environment, which means you're using a totally separate Python interpreter from your system installation when running tests in PyCharm. If you look in the lower right of the PyCharm window, there should be an indicator of which Python interpreter is currently being used. If you click on it, you'll get a drop down of interpreters available, and your system interpreter should be in that list. Personally, if I want to install a package to my system, I use pip from the command line. If I want it installed for use in a specific project, I use PyCharm. But you can configure it to work with some finagling.
🌐
Quora
quora.com › How-do-I-install-Python-packages-in-Pycharm
How to install Python packages in Pycharm - Quora
Answer (1 of 4): You don’t install them into Pycharm. What you do is in your project you associate PyCharm with your projects environment - this should be a virtual environment (I think PyCharm calls them local environments). Virtual environments are not part of Pycharm at all - they are part o...
🌐
Reddit
reddit.com › r/learnpython › can't install package to pycharm but can pip install it?
Can't install package to PyCharm but can pip install it? : r/learnpython
December 31, 2019 - You are most likely using a virtual environment. Virtual environments don’t have access to globally installed libraries. Run the same pip install command in the Pycharm terminal to install it in your virtual environment.