pip not showing correct version - python

I already had python3.8 installed and I installed python3.4 from its source code.
I wanted pip==19.1.1 as it is supported in python3.4. After installing pip when I tried changing its version but it was showing different version as you can see in the attached image.
Is there a way to use pip with version 19.1.1?
Thank you in advance.
remus#remus-VirtualBox:~$ python3.4 --version
Python 3.4.0
remus#remus-VirtualBox:~$ sudo apt install python3-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-pip is already the newest version (20.0.2-5ubuntu1.6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
remus#remus-VirtualBox:~$ pip install pip==19.1.1
Collecting pip==19.1.1
Using cached pip-19.1.1-py2.py3-none-any.whl (1.4 MB)
Installing collected packages: pip
WARNING: The scripts pip, pip3 and pip3.8 are installed in '/home/remus/.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-19.1.1
remus#remus-VirtualBox:~$ pip -V
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
Terminal Image showing error
OS: UBUNTU 20.04.4(Focal)

I strongly recommend to use something like venv or conda to create your environments. That would allow you the hassle of having to distinguish multiple python binaries on your machine.
That said, I think your issue can be resolved by explicitly using the right python version by launching pip like this:
python3.4 -m pip --version
For example, I have two different python versions installed (shame on me!) and this is the output I get:
generic#motorbrot:~$ python --version
Python 2.7.17
generic#motorbrot:~$ python -m pip --version
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
generic#motorbrot:~$ python3 --version
Python 3.6.9
generic#motorbrot:~$ python3 -m pip --version
pip 21.1.2 from /home/generic/.local/lib/python3.6/site-packages/pip (python 3.6)

Related

How can I change pip version

I'm using python3.8.6 and I need to upgrade to 3.9.x. After upgrade the python, myproject.py cannot find a module that already installed using pip3 install opencv-python.
when run python3 myproject.py occurs error that ModuleNotFoundError tensorflow, and tensorflow should be 2.5.x so I'm trying to install python 3.9.x.
pip --version shows pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)
How can I change that (python3.8) to (python3.9)?
sorry for my bad English..
python -m pip install –upgrade pip.
If you type pip list it will show you every package installed and should say something like WARNING: You are using pip version 21.2.3; however, version 21.2.4 is available.
You should consider upgrading via this command:
c:\users\x\python.exe -m pip install --upgrade pip

MacOS - Are my pip and pip3 locations correct?

I am new to python (not new to programming) and unfortunately butchered my previous python 3.7 installation while figuring things out. Long story short, I ended up deleting and reinstalling pip3, which in turn made the standard pip command (for the 2.7 pre-installed version of python o macOS) not exist. I've managed to get both installed again but am concerned with their locations.
My question is regarding the locations of both pip and pip3 when running the pip --version as well as the pip3 --version command.
Below is the output for these commands:
pip --version
pip 19.3.1 from /Users/Wyatt/Library/Python/2.7/lib/python/site-packages/pip (python 2.7)
pip3 --version
pip 19.2.3 from /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pip (python 3.8)
I believe pip3 is in the correct location, but feel that the pip command should not be located inside of my user library, but the system library like pip3. Is this correct, and if not, how can I fix this?
On my local machine MacOs the default pip resides at the following location
pip --version
pip 19.3.1 from /Library/Python/2.7/site-packages/pip-19.3.1-py2.7.egg/pip (python 2.7)
And after installing python3 using HomeBrew brew install python3, pip3 location is the following.
pip3 --version
pip 19.3.1 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)

Why is pip asking me to upgrade when it's already up-to-date?

I have a brand new installation of python 3.7.1 64-bit and I'm using the latest pyCharm as my IDE. I have no other installation of python on this machine.
I go to install numpy and I get this message:
(venv) C:\Users\John\PycharmProjects\project>pip install numpy
Requirement already satisfied: numpy in c:\users\john\pycharmprojects\pysims\venv\lib\site-packages (1.15.4)
You are using pip version 10.0.1, however version 18.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
So I run the suggested command but it's already up-to-date
(venv) C:\Users\John\PycharmProjects\project>python -m pip install --upgrade pip
Requirement already up-to-date: pip in c:\users\john\pycharmprojects\pysims\venv\lib\site-packages (18.1)
So I check the version but it's still the old version
(venv) C:\Users\John\PycharmProjects\pySIMS>pip -V
pip 10.0.1 from c:\users\john\pycharmprojects\pysims\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)
I thought I'd try py -3 to upgrade and it works.
(venv) C:\Users\John\PycharmProjects\pySIMS>py -3 -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/c2/d7/90f34cb0d83a6c5631cf71dfe64cc1054598c843a92b400e55675cc2ac37/pip-18.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 10.0.1
Uninstalling pip-10.0.1:
Successfully uninstalled pip-10.0.1
Successfully installed pip-18.1
But the version is still old
(venv) C:\Users\John\PycharmProjects\pySIMS>pip -V
pip 10.0.1 from c:\users\john\pycharmprojects\pysims\venv\lib\site-packages\pip-10.0.1-py3.7.egg\pip (python 3.7)
WHAT IS GOING ON? Am I missing something totally obvious? I've never had an issue like this working in Python 2 but since I've moved to Python 3 it's been nothing but errors.
This is looking like you have multiple installation of pip, one that comes first in the PATH (pip) and another that is recognized by python (python -m pip).
Try running the command:
pip show pip
and
python -m pip show pip
And check if the path are the same.
If not i would suggest uninstalling the undesired one, or change your your PATH environment variable to have the folder containing the correct pip come before the folder with the wrong one.
When I got this error I had 2 pip version folders in site-packages. One pip-19.2.3.dist-info and another something like pip-10.0.1. I deleted the first one, leaving only the default version. Then running python -m pip install --upgrade pip fixed the problem
I had a similar issue where I was upgrading pip; however, my issue what that I had a pip.conf file that pointed to a repo that didn't have the version to upgrade to. I removed the pip.conf to allow it to go to the default repo and it was able to download the correct version and upgrade.
1.Open you project setting(File>Settings)
2.Project>Project Interpreter
3.find pip and lick the triangle on the right(in the red circle I draw)

installing older version of python pip

I've got a brand new kubuntu 14.04.01 LTS. It has only python 2.7 supported. I need 2.6 for my work. I've found the deadsnakes repositories and I've been able to install python2.6. But now I can't find a way to install pip for python 2.6 - how can I do that?
Following #AvishBabu's answer, I downloaded the easy setuptools 2.6 egg, so I have easy_install-2.6, but it's installed inside my /usr/local/lib/python2.7/dist-packages... When I try to install pip for 2.6, I get:
$ sudo easy_install-2.6 pip
Searching for pip
Best match: pip 1.5.4
Adding pip 1.5.4 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin
Using /usr/lib/python2.7/dist-packages
Processing dependencies for pip
Finished processing dependencies for pip
which means, that only pip2.7 is taken into account.
You have to install setuptools for Python 2.6 (example :
setuptools-0.6c11-py2.6.egg). Then, you have easy_install-2.6.
You can do:
Use the command
easy_install-2.6 pip
For installing the mysql-python, use like pip-2.6 install mysql-python.
See reference.

easy_install gets wrong pip version

I have been following the instructions on http://docs.python-guide.org/en/latest/starting/install/osx/ but for some reason this is not going as I believe it would be expected.
I have python 2.7 running by default but had to get easy_install up-to-date by following the instructions on: https://superuser.com/questions/256717/easy-install-the-wrong-version-of-python-modules-mac-os and link it from /usr/local/bin/share to /usr/local/bin. It seems to be working fine.
The problem is that now when I install pip it seems to install to 2.6 and not 2.7.
darky:~ user$ easy_install --upgrade pip
Searching for pip
Reading http://pypi.python.org/simple/pip/
Reading http://pip.openplans.org
Reading http://www.pip-installer.org
Best match: pip 1.1
Processing pip-1.1-py2.6.egg
pip 1.1 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip-2.6 script to /usr/local/bin
Using /Library/Python/2.6/site-packages/pip-1.1-py2.6.egg
Processing dependencies for pip
Finished processing dependencies for pip
After the comments from MartijnPieters this problem NO LONGER persists
darky:~ user$ /usr/local/share/python/easy_install-2.7 pip
Searching for pip
Best match: pip 1.1
Processing pip-1.1-py2.7.egg
pip 1.1 is already the active version in easy-install.pth
Installing pip script to /usr/local/share/python
Installing pip-2.7 script to /usr/local/share/python
Using /usr/local/lib/python2.7/site-packages/pip-1.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
darky:~ user$ pip install virtualenv --upgrade
Requirement already up-to-date: virtualenv in /Library/Python/2.6/site-packages
Cleaning up...
But pip still creates environments with python-2.6. So I have to point it to the proper pyhton interpreter.
darky:pytravisci pedrorodrigues$ virtualenv --python=/usr/local/bin/python2.7 ENV
Running virtualenv with interpreter /usr/local/bin/python2.7
New python executable in ENV/bin/python
Installing setuptools............................done.
Installing pip...............done.
You can use
easy_install-2.7
or if you don't have that alias:
python2.7 -m easy_install <stuff>
For pip:
pip2.7

Categories

Resources