Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip for Python 3.8

How do I install Pip for Python 3.8 ? I made 3.8 my default Python version.

sudo apt install python3.8-pip 

gives

unable to locate package python3.8-pip

and running

python3.8 -m pip install [package] 

gives

no module named pip

I can't run sudo apt install python3-pip because it installs pip for Python 3.6

like image 417
Mark Avatar asked May 10 '20 18:05

Mark


People also ask

Does Python 3.8 have pip?

The current version of pip works on: Windows, Linux and MacOS. CPython 3.7, 3.8, 3.9, 3.10 and latest PyPy3.

How do I install a Python 3.8 module?

To install a Python module using pip, use the python -m pip install packagename command in your terminal. The command will install the latest version of the module and its dependencies from the Python Packaging Index.

What is pip install in Python?

pip is the package installer for Python. You can use pip to install packages from the Python Package Index and other indexes.

What is Pip and how to use it?

The PyPA recommended tool for installing Python packages. pip is the package installer for Python. You can use pip to install packages from the Python Package Index and other indexes. Please take a look at our documentation for how to install and use pip: We release updates regularly, with a new version every 3 months.

How can I change the default version of Python in PIP3?

I think the best practice is to call pip from within the python installation, which forces you to be specific on the version of python in which to install the library, ie. Alternatively, you can change the default python installation so that pip3 will refer to python3.8. For managing python versions you can use update-alternatives:

How do I update Pip to the latest version?

Another solution would be to install the pip that is in apt. sudo apt install python3-pip. The version of the pip that it installs is for all versions of Python not only for version 3.6 once installed you just need to update the pip with the command python3. 8 -m pip install pip and he will be install the latest version of pip for Python.


2 Answers

Install pip the official way:

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py python3.8 get-pip.py 

made 3.8 my default Python version

It depends on how you did that, but it might break something in your OS. For example some packages on Ubuntu 18.04 might depend on python being python2.7 or python3 being python3.6 with some pip packages preinstalled.

like image 194
RafalS Avatar answered Oct 03 '22 03:10

RafalS


sudo apt install python3.8 sudo apt install python3.8-distutils  wget https://bootstrap.pypa.io/get-pip.py sudo python3.8 get-pip.py 
like image 32
Ryabchenko Alexander Avatar answered Oct 03 '22 05:10

Ryabchenko Alexander