So previously, I had been playing around in /usr/bin (lol), and I had done a couple things: Then I restarted my shell, and because I had previously done the update-alternatives thing, I figured I could just run: sudo apt install python3-pipĪnd this did indeed now give me Python3.8 pip, but then I found out I had made a mistake. So then I looked at my $PATH variable ( echo $PATH):Īnd I randomly cd’d through folders til I got to /usr/local/bin, which had what I wanted: So here’s the full process of what I did.įirst, I uninstalled any current version of pip using apt: sudo apt remove python-pipīut pip3 -V still existed and gave the wrong version: When searching for how to do this, I found this Stack Overflow thread, but it only helped a little. This is already possible to do inside of all of my venvs, but outside of a venv, pip install gives the Python 3.5 pip, not Python 3.8. Since pip is just a package manager, and not actual software, there is not as much concern about breaking any dependencies I want to be able to type pip install instead of python3 -m pip install. Changing version of Pipīut to change version of pip, I couldn’t really find easy documentation. Certainly, I would NOT use this to make python point to python3.8. However, note from the comments here that using update-alternatives may be unsafe for some installers that expect python3 to be an older version of Python. ![]() ![]() sudo update-alternatives -install /usr/bin/python3 python3 /usr/bin/python3.8 1 If you have multiple versions installed, you just need to cd to /usr/bin, check what the path names are, and then use update-alternatives to configure which version is the default. ![]() Changing version of Python3Ĭhanging the version associated to python3 is pretty easy to find instructions about. ![]() This guide describes the process for Ubuntu 18.04.4 LTS. This proved nontrivial and totally undocumented anywhere I searched, so here’s an explanation of what I did so that I have a reference of what to do for next time, yay! I wanted to change my Python version associated with pip from 3.5 to 3.8.
0 Comments
Leave a Reply. |