How can I fix this issue? This makes no sense, i guess i have two different python path so python gets confused how can i fix this issue as well?
C:\Users\user>pip install pip
Requirement already satisfied: pip in c:\users\user\appdata\local\programs\python\python38-32\lib\site-packages (19.3.1)
WARNING: You are using pip version 19.3.1; however, version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Users\user>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages (20.0.2)
You have 2 different versions of Python (hence 2 different versions of pip) installed.
pip in c:\users\user\appdata\local\programs\python\python38-32
and
pip in c:\users\user\appdata\local\programs\python\python37-32
In the first example you did pip install pip but in the second python -m pip install --upgrade pip (The help text gave you a bad advice in this case).
If you want to upgrade the Python 3.8 pip, do pip install --upgrade pip or with the full path c:\users\kayra\appdata\local\programs\python\python38-32\python.exe -m pip install --upgrade pip.
I'm trying to upgrade pip on Centos 7. I pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7) installed.
When I run pip install --upgrade pip --user I get the following output:
Collecting pip
Using cached https://files.pythonhosted.org/packages/00/b6/9cfa56b4081ad13874b0c6f96af8ce16cfbc1cb06bedf8e9164ce5551ec1/pip-19.3.1-py2.py3-none-any.whl
Installing collected packages: pip
Successfully installed pip-8.1.2
You are using pip version 8.1.2, however version 19.3.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
What I've tried
I've tried the following, which have all resulted in the same output and result as above:
pip install --upgrade pip --user
pip install -U pip --user --ignore-installed
pip install -U pip --user --ignore-installed --no-cache-dir
sudo yum update pip which returns
No Match for argument: pip
No package pip available.
No packages marked for update
sudo yum update python-pip which returns No packages marked for update
Observations
python -m pip --version outputs:
pip 19.3.1 from /home/deploy/.local/lib/python2.7/site-packages/pip (python 2.7)
pip --version outputs:
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)
You need to update your PATH to include /home/deploy/.local/lib/python2.7/bin before /usr/lib/python2.7/bin if you want pip to resolve to the same location as python. Otherwise, python -m pip is the more proper usage pattern
Otherwise, you're looking at two completely separate python installations and pip is indeed upgraded in one of them
Note: Python2 is end of life, so probably best to remove the one in your home folder, anyway, and switch to using something like Pipenv or pyenv
Seems like a stupid question but....I can't figure it out.
I can run programs in python2 like so :
python run.py
I can run programs in python3 with :
python3 run.py
However
pip install pandas
will install pandas for Python2.
How do I make it install for Python3?
I have tried -
curl -O https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
This installs pip, but when I try to install some requirements for a project, I get the error :
You are using pip version 9.0.3, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Upgrading it using :
python3 -m pip install --upgrade pip
results in :
Requirement already up-to-date: pip in /usr/lib/python3.6/site-packages (19.0.3)
Thanks.
as
$ ls -1 /usr/bin/pip*
/usr/bin/pip2
/usr/bin/pip2.7
/usr/bin/pip3
/usr/bin/pip3.6
you should run
pip3 install pandas
In your CMD write:
where pip
then:
where pip3
I believe, pip3 which you'll find it's path in your python\sctips\ is what you need to use; it is the Python3 version of pip
So you can try:
pip3 install pandas
You can always run pip as a module:
python2 -m pip <pip commands here>
python3 -m pip <pip commands here>
python3.6 -m pip <pip commands here> # same as python3 as of this post
python3.7 -m pip <pip commands here>
I want to use python3.5 for development, but many times when I install the module for python 3.5, it always fails. The terminal tells me that a higher version is available, but it doesn't work when I upgrade it.
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/
To upgrade your pip3, try running:
sudo -H pip3 install --upgrade pip
Your pip may move from /bin to /usr/local/bin
To upgrade pip as well, you can follow it by:
sudo -H pip2 install --upgrade pip
Try this command:
pip3 install --upgrade setuptools pip
First decide which pip you want to upgrade, i.e. just pip or pip3.
Mostly it'll be pip3 because pip is used by the system, so I won't recommend upgrading pip.
The difference between pip and pip3 is that
NOTE: I'm referring to PIP that is at the BEGINNING of the command
line.
pip is used by python version 2, i.e. python2
and
pip3 is used by python version 3, i.e. python3
For upgrading pip3: # This will upgrade python3 pip.
pip3 install --upgrade pip
For upgrading pip: # This will upgrade python2 pip.
pip install --upgrade pip
This will upgrade your existing pip to the latest version.
The Problem
You use pip (the Python 2 one). Now you want to upgrade pip (the Python 3 one). After that, pip is the Python 3 one.
The solution
Use pip2 and pip3. This way it is explicit.
If you want to use pip, just check where it is (which pip) and change the link. For example:
$ which pip
/usr/local/bin/pip
$ pip --version
pip 9.0.1 from /usr/local/lib/python3.5/dist-packages (python 3.5)
$ which pip2
/usr/local/bin/pip2
$ sudo rm /usr/local/bin/pip
$ sudo ln -s /usr/local/bin/pip2 /usr/local/bin/pip
$ pip --version
pip 9.0.1 from /usr/local/lib/python2.7/dist-packages (python 2.7)
for Python 3:
python3 -m pip install --upgrade pip
for Python 2:
python2 -m pip install --upgrade pip
What worked for me was the following command:
python -m pip install --upgrade pip
pip3 install --upgrade pip worked for me
In Ubuntu 18.04, below are the steps that I followed.
python3 -m pip install --upgrade pip
For some reason you will be getting an error, and that be fixed by making bash forget the wrongly referenced locations using the following command.
hash -r pip
If you have 2 versions of Python (eg: 2.7.x and 3.6), you need do:
add the path of 2.x to system PATH
add the path of 3.x to system PATH
pip3 install --upgrade pip setuptools wheel
for example, in my .zshrc file:
export PATH=/usr/local/Cellar/python#2/2.7.15/bin:/usr/local/Cellar/python/3.6.5/bin:$PATH
You can exec command pip --version and pip3 --version check the pip from the special version. Because if don't add Python path to $PATH, and exec pip3 install --upgrade pip setuptools wheel, your pip will be changed to pip from python3, but the pip should from python2.x
This worked for me (mac)
sudo curl https://bootstrap.pypa.io/get-pip.py | python
If you try to run
sudo -H pip3 install --upgrade pip3
you will get the following error:
WARNING: You are using pip version 19.2.3, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
but if you upgrade using the suggested command:
pip install --upgrade pip
then, the legacy pip will be upgraded, so what I did is the following:
which pip3
and I located my pip3 installation (just in case the following command wouldn't upgrade the legacy pip. Then i changed to that directory and upgraded pip3 using the following commands: (your directory could be different)
cd /Library/Frameworks/Python.framework/Versions/3.8/bin
sudo -H pip3 install --upgrade pip
after this:
pip --version
will still show the legacy version, while
pip3 --version
will show pip 21.0.1
In cygwin I can't upgrade pip, it worked find in cmd:
$ python -m pip install --upgrade pip
/usr/bin/python: No module named pip
Likely you don't need the python -m part. If pip is in your path, then just typing pip install --upgrade pip should work. Where is pip installed? which pip will tell you where it's located, if it's in your path