You are using pip3 to install flask-script which is associated with python 3.5. However, you are trying to upgrade pip associated with the python 2.7, try running pip3 install --upgrade pip.

It might be a good idea to take some time and read about virtual environments in Python. It isn't a best practice to install all of your packages to the base python installation. This would be a good start: http://docs.python-guide.org/en/latest/dev/virtualenvs/

Answer from JanHak on Stack Overflow
🌐
Note.nkmk.me
note.nkmk.me › home › python
How to Use pip (Install, Update, Uninstall Packages) | note.nkmk.me
April 18, 2025 - $ pip install --upgrade <package-name> $ pip install -U <package-name> Pip itself is also managed through pip. You can update pip to the latest version just like any other package, using the following command.
Discussions

Pip upgrade to 22.3 windows10 - Packaging - Discussions on Python.org
Hi all, I’m trying to upgrade my pip version. I’m running in cmd promtp as admin and my error is this When I go to my python 3.9 directory, I don’t seem to have a .py script to run the upgrade. When I’m in cmd prompt and go to python, my version comes up as “C:\WINDOWS\system32>python ... More on discuss.python.org
🌐 discuss.python.org
0
November 6, 2022
Pip keeps telling me to upgrade pip, even right after upgrading pip
I did not expect pip to tell me to upgrade pip just after pip upgraded pip. And I did not expect pip to give me instructions that didn’t work. What is this? Expected outcome. Bug in 3.14.0rc1. (Let’s tell the devs.) Bug in pip 25.1.1. (Let’s tell the devs.) More on discuss.python.org
🌐 discuss.python.org
4
0
August 9, 2025
Oops! upgraded root's pip3 with python3 -m pip install --upgrade pip - How to reset to RHEL8 default?
Keep poking at alternatives, that’s the solution. The RPM-provided versions of pip will not write any files in /usr/local. The pip-installed packages should be entirely within /usr/local. So make sure none of the symlinks in /etc/alternatives point into /usr/local by running the necessary “alternatives” Invocations. You may also want to move the pip stuff out of /usr/local so it’s not picked up by any python programs which look in there as part of resolving module includes. (I say move rather than delete, just in case you need to revert). More on reddit.com
🌐 r/redhat
9
6
January 9, 2021
RUN pip install --upgrade pip and RUN pip install -r requirements.txt not working
so here’s the story, this is my first time using docker because i was told it is really easy to deploy script, model and many more. Today i try to build my first docker image for my python script using flask. i try to build it and it work on the first couple of iteration and fail like 10 ... More on forums.docker.com
🌐 forums.docker.com
8
0
December 15, 2023
🌐
MTU Service Desk
servicedesk.mtu.edu › TDClient › 1801 › Portal › KB › PrintArticle
Installing, uninstalling, or upgrading Python modules using Pip (Linux)
Python modules are packages, or modules, which can be imported into a project to use. This includes packages like matplotlib, numpy, flask, and many more. You can install and uninstall packages for Python with the Pip package manager. Python modules that are stored on your home drive will only ...
🌐
freeCodeCamp
freecodecamp.org › news › pip-upgrade-and-how-to-update-pip-and-python
Pip Upgrade – And How to Update Pip and Python
March 14, 2023 - In cases when you want to update only Pip, open your terminal and run pip3 install --upgrade pip.
🌐
River
river.me › blog › change-pip-version
Update pip/pip3 to Python 3.8 in Ubuntu – River Writes - A MediaWiki Blog
April 11, 2021 - So now pip was working, but when ... and came across this Stack Overflow thread which suggested that I run the following: python3 -m pip install --upgrade --force-reinstall pip...
Find elsewhere
🌐
PyPI
pypi.org › project › pip
pip · PyPI
3 weeks ago - You can use pip to install packages from the Python Package Index and other indexes.
      » pip install pip
    
Published   May 31, 2026
Version   26.1.2
🌐
pip
pip.pypa.io › en › stable › installation
Installation - pip documentation v26.1.2
There are also zip applications for specific pip versions, named pip-X.Y.Z.pyz. The zip application can be run using any supported version of Python: ... You may need to configure your system to recognise the .pyz extension before this will work. Depending on how you installed Python, there might be other mechanisms available to you for installing pip such as using Linux package managers.
🌐
DataCamp
datacamp.com › tutorial › pip-upgrade-python
How to Upgrade Pip and Python in Windows, MacOS, and Linux | DataCamp
December 23, 2025 - Read our step-by-step instructions for performing a Pip upgrade Python process on Windows, macOS, and Linux. Keep your environment up-to-date and compatible.
🌐
Flexiple
flexiple.com › python › pip-upgrade
Pip Upgrade – And How to Update Pip and Python - Flexiple
March 4, 2024 - Upgrade Python: If you have Python installed via Homebrew, you can upgrade it to the latest version by executing: ... Upgrade Pip: After upgrading Python, upgrade Pip to ensure it's compatible with the new Python version.
🌐
Python.org
discuss.python.org › packaging
Pip upgrade to 22.3 windows10 - Packaging - Discussions on Python.org
November 6, 2022 - Hi all, I’m trying to upgrade my pip version. I’m running in cmd promtp as admin and my error is this When I go to my python 3.9 directory, I don’t seem to have a .py script to run the upgrade. When I’m in cmd pro…
🌐
GitHub
github.com › realiti4 › pip-upgrade
GitHub - realiti4/pip-upgrade: Upgrade your pip packages with one line. A fast, reliable and easy tool for upgrading all of your packages while not breaking any dependencies · GitHub
Upgrade your pip packages with one line. A fast, reliable and easy tool for upgrading all of your packages while not breaking any dependencies - realiti4/pip-upgrade
Starred by 36 users
Forked by 3 users
Languages   Python
🌐
Python⇒Speed
pythonspeed.com › articles › upgrade-pip
Why you should upgrade pip, and how to do it
March 21, 2023 - Let’s see some symptoms so you can identify the problem, how to solve it by upgrading pip, and finally—if you’re sufficiently interested—what causes it. Let’s start out with an Ubuntu 18.04 Docker image. Released in April 2018, this version of Ubuntu has Python version 3.6, and pip version 9. [itamarst@blake dev]$ docker run -it ubuntu:18.04 root@1a43d55f0524:/# apt-get update ... root@1a43d55f0524:/# apt-get install --no-install-recommends python3 python3-pip ... root@1a43d55f0524:/# pip3 --version pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
🌐
pip
pip.pypa.io › en › latest › installation
Installation - pip documentation v26.2.dev0
There are also zip applications for specific pip versions, named pip-X.Y.Z.pyz. The zip application can be run using any supported version of Python: ... You may need to configure your system to recognise the .pyz extension before this will work. Depending on how you installed Python, there might be other mechanisms available to you for installing pip such as using Linux package managers.
🌐
Python.org
discuss.python.org › python help
Pip keeps telling me to upgrade pip, even right after upgrading pip - Python Help - Discussions on Python.org
August 9, 2025 - I did not expect pip to tell me to upgrade pip just after pip upgraded pip. And I did not expect pip to give me instructions that didn’t work. What is this? Expected outcome. Bug in 3.14.0rc1. (Let’s tell the devs.) B…
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › using the raspberry pi › advanced users
upgrading pip fails - Raspberry Pi Forums
You should consider upgrading via the 'pip install --upgrade pip' command. however - doing either 'pip install --upgrade pip' or 'sudo pip install --upgrade pip results in a 'command not found' error... robbes · Posts: 161 · Joined: Sun Jan 20, 2013 7:11 pm · Sun Mar 19, 2017 5:40 am · ...
🌐
Reddit
reddit.com › r/redhat › oops! upgraded root's pip3 with python3 -m pip install --upgrade pip - how to reset to rhel8 default?
r/redhat on Reddit: Oops! upgraded root's pip3 with python3 -m pip install --upgrade pip - How to reset to RHEL8 default?
January 9, 2021 -

On some RHEL8.3 box's I've accidentally upgraded root's pip version with an ansible playbook because I did not set become_user=appuser in the pip module. So it took the become for the playbook with root. I required a newer version of pip 20.x for a module for an application user only. I've gotten that done with --user argument for new deploys but I need to fix existing 4 servers.

Doing some reading around it was pretty obviously this was a bad idea!! Is there a way to get the system-wide pip state back to normal?

The default is using pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

located /usr/bin/pip3

/usr/bin/pip3 -> /etc/alternatives/pip3

python3 -m pip install --upgrade pip

After the mistake pip is 20.3.3 from /usr/local/lib/python3.6/site-packages/pip (python 3.6)

I've since used python3 -m pip install pip --upgrade --user and/or updated the ansible with become_user=appuser.

Couple things I've tried that did not work. I've been setting up fresh VMs the last 3 hours and can't find a solution.

  1. Ran python3 -m pip install pip=9.0.3 but this is just 9.0.3 on /usr/local/ instead of /usr/lib.

  2. update-alternatives because I noticed python3 is in "manual" now compared to "auto" on a fresh rhel8 install.

  3. yum reinstall of pip packages.

  4. yum reinstall of python3

  5. yum remove and install python3 (I don't think removing python3 is a good idea just wanted to test it - it did not fix pip).

Any help is much appreciated.

Top answer
1 of 4
3
Keep poking at alternatives, that’s the solution. The RPM-provided versions of pip will not write any files in /usr/local. The pip-installed packages should be entirely within /usr/local. So make sure none of the symlinks in /etc/alternatives point into /usr/local by running the necessary “alternatives” Invocations. You may also want to move the pip stuff out of /usr/local so it’s not picked up by any python programs which look in there as part of resolving module includes. (I say move rather than delete, just in case you need to revert).
2 of 4
3
Fedora 27 added protections to prevent pip the application from overwriting files owned by pip the package (see the Making sudo pip safe change proposal ). This feature is included in RHEL8. As you noticed, your new version of pip is installed in /usr/local/lib/python3.6/site-packages, which is an override of the stock /usr/lib/python3.6/site-packages location. Only the python3 command sees that override. System tools like dnf ignore it to prevent pip from breaking them. To revert you just need to uninstall pip the same way you installed it. python3 -m pip uninstall pip That uninstalls pip from /usr/local/lib/python3.6/site-packages, but leaves the stock location alone, so the next time you import pip it will use the stock location again. The only thing that doesn't get fully restored is the alternatives symlinks like /usr/bin/pip3, which can be fixed with this command. alternatives --auto python3 Optionally you can delete the now empty /usr/local/lib/python3.6 and /usr/local/lib/python3.6/site-packages directories.
🌐
Docker Community
forums.docker.com › general
RUN pip install --upgrade pip and RUN pip install -r requirements.txt not working - General - Docker Community Forums
December 15, 2023 - so here’s the story, this is my first time using docker because i was told it is really easy to deploy script, model and many more. Today i try to build my first docker image for my python script using flask. i try to build it and it work on the first couple of iteration and fail like 10 times on the RUN section this is the log [+] Building 9.7s (9/10) docker:default => [internal] load build definition from Dockerf...
🌐
Apple Community
discussions.apple.com › thread › 250724435
how to update pip - Apple Community
October 10, 2019 - You should consider upgrading via the 'pip install --upgrade pip' command. However, typing the above generates the following error: ... Using the which command, I noticed that there's a pip3 but there doesn't seem to be any pip!