![]() If you just want to casually run Python 3, type python3 on the command-line. Many Linux distros still link /usr/bin/python to python2 rather than python3. Type "help", "copyright", "credits" or "license" for more information. If you run your python3 again, you should have it updated: $ python3 Sudo ln -sf /usr/bin/python3.10-config /usr/bin/python3-config If you opted by not using update-alternatives, you'll need to also execute: sudo ln -sf /usr/bin/python3.10 /usr/bin/python3 You can select the version you want to use. To change the Python version, use: sudo update-alternatives -config python3Ī menu with choices will be shown. This registers your Python versions in update-alternatives. Sudo update-alternatives -install /usr/bin/python3 python3 /usr/bin/python3.10 2 Run the following commands: sudo update-alternatives -install /usr/bin/python3 python3 /usr/bin/python3.5 1 I'll describe both just for educational purposes. The first one is a little bit better, using update-alternatives. You'll need to update the symbolic links, using one of the two methods below. ![]() This doesn't update the symlink automatically. Second, install your chosen Python version, specifying explicitly the minor version: sudo apt install python3.10 python3.10-venv python3.10-dev Sudo add-apt-repository ppa:deadsnakes/ppa Step-by-step about how to do itįirst, update and upgrade everything, install software-properties-common package (to deal with PPA keys), import deadsnakes PPA repository and update the apt index again: sudo apt update & sudo apt upgrade -y Turns out that you'll also need to import an apt-specific repository through its PPA key. To install, let's say, Python 3.10, you'll need to install a new version, mentioning also the minor version. In other words, you'll have the most updated 3.5 version, but not the most updated 3 version. When you upgrade python3.5, you're upgrading the minor-minor version inside 3.5, but not moving out from 3.5. Well, it's not the case for Python in apt, apparently. ![]() But, why? In theory if you upgrade, the minor version should go up, right? This indicates that your python3 command still points to your python3.5 installation. The response will be: lrwxrwxrwx 1 root root 9 /usr/bin/python3 -> python3.5 In other words, if you try: which python3 Updating Python 3 using sudo apt-get upgrade python3 doesn't change the symlink automatically.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |