[{"element_type":"text","content":"\n  \n  \n  \n  \n        \u003cp\u003eI use Debian Linux; the current stable version of Debian has Python 3.11.2. At the time I write this, Python 3.13 has just been released. So I used my desire to try out the new Python as a chance to explore uv as well. My instructions here are tested on Debian Linux, but may work with modifications on other Linux-based systems like Ubuntu or Raspberry Pi OS.\u003c/p\u003e\n\u003ch2\u003eWhat's uv, anyway?\u003c/h2\u003e\n\u003cp\u003euv is \"An extremely fast Python package and project manager, written in Rust.\" It's on \u003ca href=\"https://github.com/astral-sh/uv\"\u003egithub\u003c/a\u003e and \u003ca href=\"https://pypi.org/project/uv/\"\u003epypi\u003c/a\u003e and is also \u003ca href=\"https://docs.astral.sh/uv/\"\u003ewell-documented\u003c/a\u003e.\u003c/p\u003e\n\u003cp\u003eAmong its many features, uv is capable of managing multiple versions of Python, so I decided to use it to test drive Python 3.13.\u003c/p\u003e\n      \n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eInstalling uv via pipx\u003c/h2\u003e\n\u003cp\u003eFirst, install the\u0026nbsp;\u003cstrong\u003epipx\u003c/strong\u003e command using the operating system package manager. (debian package name: \u003cstrong\u003epipx\u003c/strong\u003e)\u003c/p\u003e\n\u003cp\u003eThen, install uv:\u0026nbsp;\u003ccode\u003epipx install uv\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eOnce you've done this, you should have the\u0026nbsp;\u003ccode\u003euv\u003c/code\u003e command available. However, you may see a warning like this:\u003c/p\u003e\n      \n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"⚠️  Note: '/home/example/.local/bin' is not on your PATH environment variable.\n    These apps will not be globally accessible until your PATH is updated. Run\n    `pipx ensurepath` to automatically add it, or manually modify your PATH in\n    your shell's config file (i.e. ~/.bashrc).\ndone! ✨ 🌟 ✨","metadata":{"language":"terminal","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003cp\u003eOn Debian Linux, this message can\u0026nbsp;\u003cstrong\u003ebe ignored\u003c/strong\u003e. Instead, simply log out and log back in again. The per-user\u0026nbsp;\u003cstrong\u003e.local/bin\u003c/strong\u003e directory is supported by default, but is only added to the path when exists at the moment you logged in. (it may also suffice to simply re-open your terminal window, so try that first if you would prefer to avoid logging out)\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eInstalling Python versions via uv\u003c/h2\u003e\n\u003cp\u003eJust run \u003ccode\u003euv python install 3.13\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003eAt the moment, uv does not have the stable release of Python 3.13, so it installs a release candidate version instead:\u003c/p\u003e\n      \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"$ uv python install 3.13\nSearching for Python versions matching: Python 3.13\nInstalled Python 3.13.0rc3 in 1.49s\n + cpython-3.13.0rc3-linux-x86_64-gnu","metadata":{"language":"terminal","linenums":false}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eRunning Python by version with uv\u003c/h2\u003e\n\u003cp\u003e\"uv run\" can accept a Python version. If the command is \"python\", the interactive Python prompt is started. If it's a Python script with the \u003cstrong\u003e.py\u003c/strong\u003e extension, the script is run.\u003c/p\u003e\n      \n\n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"$ uv run --python 3.13 python\nPython 3.13.0rc3 (main, Oct  2 2024, 17:18:08) [Clang 18.1.8 ] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e","metadata":{"language":"terminal","linenums":false}},{"element_type":"text","content":"\n        \u003cp\u003eOne of the headline features, the new multiline editor, seems to work like a treat. Here, I've used the cursor up key to edit the \u003ccode\u003eif\u003c/code\u003e line after I hit enter and started typing the if-statement's body:\u003c/p\u003e\n      ","metadata":{}},{"element_type":"user_image","content":"https://cdn-learn.adafruit.com/user_assets/assets/000/001/254/original/Screenshot_2024-10-08_10-25-41.png?1728485126","metadata":{"caption":""}},{"element_type":"text","content":"\n  \n  \n  \n  \n  \n  \n  \n        \u003ch2\u003eCreating a virtual environment with specific Python version with uv\u003c/h2\u003e\n\u003cp\u003eThe \"uv venv\" command creates a virtual environment. Again, a Python version can be specified. When the environment is activated (which lasts until you close that shell or terminal window), the\u0026nbsp;\u003ccode\u003epython\u003c/code\u003e command refers to the specified version instead of the default version.\u003c/p\u003e\n      \n\n\n\n\n\n\n","metadata":{}},{"element_type":"code","content":"$ uv venv --python 3.13 venv-3.13\nUsing CPython 3.13.0rc3\nCreating virtual environment at: venv-3.13\nActivate with: source venv-3.13/bin/activate\nkepler@bert:~$ source venv-3.13/bin/activate\n(venv-3.13) $ python\nPython 3.13.0rc3 (main, Oct  2 2024, 17:18:08) [Clang 18.1.8 ] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e","metadata":{"language":"terminal","linenums":false}}]