Installation
Rye is built in Rust. It can either be manually compiled and installed or it can be installed from a binary distribution yet. It has support for Linux, macOS and Windows.
Installing Rye
Rye is installed per-user and self manages itself. It will install itself into a folder in your home directory and mange itself there.
To install run you can curl a command which will install the right binary for your operating system and CPU architecture and install it:
curl -sSf https://rye-up.com/get | bash
Alternatively if you don't trust this approach, you can download the latest release binary. On first run it will install itself.
- rye-x86_64-linux.gz for 64bit Intel computers
- rye-aarch64-linux.gz for 64bit ARM computers
gunzip rye-x86_64-linux.gz
chmod +x ./rye-x86_64-linux
./rye-x86_64-linux
To install run you can curl a command which will install the right binary for your operating system and CPU architecture and install it:
curl -sSf https://rye-up.com/get | bash
Alternatively if you don't trust this approach, you can download the latest release binary. On first run it will install itself.
- rye-aarch64-macos.gz for M1/M2 Macs
- rye-x86_64-macos.gz for Intel Macs
gunzip rye-aarch64-macos.gz
chmod +x ./rye-aarch64-macos
./rye-aarch64-macos
To install Rye on windows download the latest release and run the binary. Upon first run it will install itself. Please note that it's strongly recommended to have "Developer Mode" activated when using Rye and before starting the installation. Learn more.
- rye-x86_64-windows.exe for 64bit Intel Windows
- rye-x86-windows.exe for 32bit Intel Windows
Note
Rye does not yet use signed binaries which means that you will need to allow the execution of the downloaded executable. If there is no obvious way to do so, click on "More info" on the error message that shows up and then on "Run anyway".
You need to have Rust and Cargo installed. If you don't have, you can use rustup to get them onto your machine.
Afterwards you can install Rye
via cargo
:
cargo install --git https://github.com/mitsuhiko/rye rye
Rye will automatically download suitable Python toolchains as needed. For more information about this read about toolchains. To install a specific version download a binary directly from GitHub.
Customized Installation
On some platforms there is some limited support for customizing the installation experience.
The install script that is piped to bash
can be customized with some environment
variables:
RYE_VERSION
-
Defaults to
latest
. Can be set to an explicit version to install a specific one. RYE_INSTALL_OPTION
-
Can optionally be set to
"--yes"
to skip all prompts. RYE_TOOLCHAIN
-
Optionally this environment variable can be set to point to a Python interpreter that should be used as the internal interpreter. If not provided a suitable interpreter is automatically downloaded.
At present only CPython 3.9 to 3.11 are supported.
This for instance installs a specific version of Rye without asking questions:
curl -sSf https://rye-up.com/get | RYE_VERSION="0.4.0" RYE_INSTALL_OPTION="--yes" bash
The install script that is piped to bash
can be customized with some environment
variables:
RYE_VERSION
-
Defaults to
latest
. Can be set to an explicit version to install a specific one. RYE_INSTALL_OPTION
-
Can optionally be set to
"--yes"
to skip all prompts. RYE_TOOLCHAIN
-
Optionally this environment variable can be set to point to a Python interpreter that should be used as the internal interpreter. If not provided a suitable interpreter is automatically downloaded.
At present only CPython 3.9 to 3.11 are supported.
This for instance installs a specific version of Rye without asking questions:
curl -sSf https://rye-up.com/get | RYE_VERSION="0.4.0" RYE_INSTALL_OPTION="--yes" bash
The Windows installer has limited support for customizations via environment
variables. To set these you need to run the installer from cmd.exe
.
RYE_TOOLCHAIN
-
Optionally this environment variable can be set to point to a Python interpreter that should be used as the internal interpreter. If not provided a suitable interpreter is automatically downloaded.
At present only CPython 3.9 to 3.11 are supported.
This for instance installs Rye with a specific toolchain:
set RYE_TOOLCHAIN=%USERPROFILE%\AppData\Local\Programs\Python\Python310\python.exe
rye-x86_64-windows.exe
Add Shims to Path
Once rye
is installed you need to add the shims
folder into your PATH
.
This folder is a folder that contains "shims" which are executables that
Rye manages for you as well as the rye
executable itself. For instance any
Python installation managed by Rye will be available via a shim placed there.
On macOS or Linux you can accomplish this by adding it to your .bashrc
, .zshrc
or similar. This step is technically optional but required if you want to be able to
just type python
or rye
into the shell to pick up the current virtualenv's Python
interpreter.
Rye ships an env
file which should be sourced to update PATH
automatically.
echo 'source "$HOME/.rye/env"' >> ~/.bashrc
Rye ships an env
file which should be sourced to update PATH
automatically.
echo 'source "$HOME/.rye/env"' >> ~/.zshrc
Since fish does not support `env`` files, you instead need to add the shims directly. This can be accomplished by running this command once:
set -Ua fish_user_paths "$HOME/.rye/shims"
Rye ships an env
file which should be sourced to update PATH
automatically.
echo '. "$HOME/.rye/env"' >> ~/.profile
To modify the Windows PATH environment variable
- Press Win+R, enter
sysdm.cpl
and hit Enter. - In the "System Properties" dialog, click the "Advanced" tab.
- Click on "Environment Variables".
- In the top list, double click on the
Path
variable. - In the "Edit environment variable" dialog click on "New".
- Enter
%USERPROFILE%\.rye\shims
and hit Enter. - Click repeatedly on "Move Up" until the newly added item is at the top.
- Click on "OK" and close the dialog.
Note that you might need to restart your login session for this to take effect.
There is a quite a bit to shims and their behavior. Make sure to read up on shims to learn more.
Updating Rye
To update rye to the latest version you can use rye
itself:
rye self update
Uninstalling
If you don't want to use Rye any more, you can ask it to uninstall it again:
rye self uninstall
Additionally you should delete the remaining .rye
folder from your home directory and
remove .rye/shims
from the PATH
again. Rye itself does not place any data
in other locations. Note though that virtual environments created by rye will
no longer function after Rye was uninstalled.
Preventing Auto Installation
Rye when launched will normally perform an auto installation. This can be annoying
in certain development situations. This can be prevented by exporting the
RYE_NO_AUTO_INSTALL
environment variable. It needs to be set to 1
to disable
the feature.
export RYE_NO_AUTO_INSTALL=1
export RYE_NO_AUTO_INSTALL=1
set RYE_NO_AUTO_INSTALL=1