Uninstall python3-pip & python-pip using apt.Ignoring the detour we took, you need to: ![]() Now let’s just remove the bad symlinks from /usr/bin and make sure everything still works: So I added /home/river/.local/bin/ to my $PATH (before doing this, I echo $PATH’d just in case I messed up): export PATH="/home/river/.local/bin/:$PATH"Īnd I also put it into ~/.profile and ~/.config/fish/config.fish per this Ask Ubuntu post. What a helpful warning! The resolution - actually a necessary setup step I didn’t find that too helpful, but I instead searched the actual text of the message, and came across this Stack Overflow thread which suggested that I run the following: python3 -m pip install -upgrade -force-reinstall pip So now pip was working, but when I ran pip -V I got this warning: Turns out…this was NOT what I wanted to do. The second was to create a symlink from pip to pip3: sudo ln -s /usr/bin/pip3 pip The first was to create a symlink from pip3 to the pip package in my Python 3.8 installation: ln -s pip3 /home/river/.local/lib/python3.8/site-packages/pip 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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |