When running pip3.8
i get the following warning appearing in my terminal
WARNING: The script pip3.8 is installed in '/usr/local/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.1.1 setuptools-56.0.0
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: https://pip.pypa.io/warnings/venv
How to solve this problem on centos 7?
2
Answers
This question has been answered on the serverfaults forum: Here is a link to the question.
You need to add the following line to your
~/.bash_profile
or~/.bashrc
file.You will then need to profile, do this by either running the command:
Or by simply closing your terminal and opening a new session. You should continue to check your
PATH
to make sure it includes the path.The other answers will work, but I found a more idiomatic way to do it on an AWS fresh install of Ubuntu 20.04.
That path statement is already there, but in .profile
You’ll need to log out, and log back in. Sourcing the environment won’t do it.
REASON:
In .profile, the code:
will execute and automatically add .local/bin to your Path, when you log on.
If you install pip3 via
sudo apt install python3-pip
that directory JUST got created, and you haven’t logged out yet – and so that path statement hasn’t executed.You could also execute .profile after doing the
sudo apt install
.