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
The current version of pip works on: Windows, Linux and MacOS. CPython 3.7, 3.8, 3.9, 3.10 and latest PyPy3.
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.
pip is the package installer for Python. You can use pip to install packages from the Python Package Index and other indexes.
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.
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:
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With