Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade to Ubuntu 20.04 killed pip

I upgraded to Ubuntu 20.04 from 19.10 and now I cannot use pip.

zeno:~$ pip --version

Command 'pip' not found, but there are 18 similar ones.

Python is installed:

zeno:~$ python3 --version
Python 3.8.2

but if I try to insatll pip, I get this:

    zeno:~/Desktop/tetris$ 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).
    The following packages were automatically installed and are no longer required:
     dh-python elpa-async enchant gedit-plugin-zeitgeist gir1.2-mutter-5
     gnome-software-common libappstream-glib8 libapt-pkg5.90
     libboost-date-time1.67.0 libboost-iostreams1.67.0 libbrlapi0.6
     libcodec2-0.8.1 libcroco3 libdns-export1104 libdns1104 libdvdread4
     libegl1-mesa libenchant1c2a libept1.5.90 libevent-2.1-6 libexiv2-14
     libfprint0 libgeoip1 libgit2-27 libglvnd-core-dev libgnome-desktop-3-18
     libgspell-1-1 libgutenprint-common libgutenprint9 libgweather-3-15 libicu63
     libiptc0 libisc-export1100 libisc1100 libisc1105 libisl21 liblivemedia64
     liblouis17 liblwres161 libmicrodns0 libmozjs-60-0 libmutter-5-0 libmysofa0
     libnettle6 liboauth0 libperl5.28 libplymouth4 libpoppler90
     libpython3.7-minimal libqpdf21 libsnmp30 libusbmuxd4 libx11-xcb-dev
     libx265-176 libxcb-dri2-0-dev libxcb-dri3-dev libxcb-shape0-dev
     libxcb-sync-dev libxcb-xfixes0-dev libxshmfence-dev libzeitgeist-2.0-0
     perl-modules-5.28 printer-driver-gutenprint python-gobject-2
     python3-asn1crypto python3-pypdf2 python3.7-minimal ubuntu-system-service
     x11proto-composite-dev x11proto-fixes-dev
   Use 'sudo apt autoremove' to remove them.
   0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I am lost. Thanks for any help

Update

I use venv to create virtual environments. When no venv is activated, I can use pip3:

zeno:~/Desktop/tetris$ pip3 -V
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

but if I activate a venv, it does not work:

(.tetris) zeno:~/Desktop/tetris$ pip3
Traceback (most recent call last):
  File "/home/zeno/Desktop/tetris/.tetris/bin/pip3", line 6, in <module>
    from pip._internal import main
ModuleNotFoundError: No module named 'pip'

Thank you for your suggestions and continued help.

Update

I tried deleting the venv and making a new one, but it seems I need pip working in order to do that:

zeno:~/Desktop/tetris$ python3 -m venv .tetris

gives:

The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/zeno/Desktop/tetris/.tetris/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']
like image 391
Eric Chancellor Avatar asked May 09 '20 16:05

Eric Chancellor


People also ask

Why is pip not installed on Ubuntu?

The python-pip package manager works as an independent package manager on Linux distribution. This means you need to install the pip tool separately from python programs. The pip command is not found an error raised on your Linux terminal window if the pip is not installed independently on Ubuntu 20.04 system.

Is pip pre installed in Ubuntu?

It is a package management utility that allows you to install and manage Python software packages easily. Ubuntu doesn't come with pre-installed Pip, but here is how you can perform the installation in several simple steps.

Is pip included in Ubuntu?

Pip is not installed by default on Ubuntu – however, the installation is quite quick and simple.

Does upgrading pip upgrade Python?

Many users question exactly just how to upgrade to the latest version of PIP, given the ever-evolving and fast-moving python ecosystem. The short answer is, pip is just like any other PyPI package and you can upgrade it to newer (or downgrade to older) versions, just as you would upgrade or downgrade any other package.


1 Answers

Sometimes after OS upgrade you need to reinstall packages. Try:

sudo apt install --reinstall python3-pip
like image 84
ofirule Avatar answered Oct 14 '22 09:10

ofirule