Install Python
uv.
uv is not Posit Software and is included in Third Party Materials (as defined in our EULA) and not covered under the Posit Support Agreement. If you download uv, you are agreeing to their license and acknowledge Posit is not responsible for uv and you are downloading uv at your sole risk.
Posit no longer builds its own Python binaries. Previous Posit-built versions will remain available, but new patch versions for Python 3.9 - 3.13 will not be built. Python 3.14 and later will not be provided.
You are not required to replace existing Python installations.
For directions on installing Python from source, see the Python documentation.
Install required dependencies
You can install standalone versions of python using uv. Specify UV_INSTALL_DIR to change the installation location of the executable:
curl -LsSf https://astral.sh/uv/install.sh | sudo env UV_INSTALL_DIR=/usr/local/bin shSpecify the Python version
Consult with your Python user group to determine which versions of Python they would like installed. Once defined, set the environment variable to the first Python version they request:
export PYTHON_VERSION="3.12.4"Download and install Python
Download and install the desired version of Python:
sudo /usr/local/bin/uv python install "${PYTHON_VERSION}" --install-dir=/opt/python
sudo ln -s /opt/python/cpython-$PYTHON_VERSION-* /opt/python/$PYTHON_VERSIONVerify Python installation
Verify that Python is installed by running the following command:
/opt/python/"${PYTHON_VERSION}"/bin/python --version(Optional) Configure a PyPI repository
To specify a default PyPI mirror for all installations of Python, create
a pip configuration file. This can be useful if you are using an internal PyPI mirror such as Posit Package Manager:
Create a file located at /etc/pip.conf containing:
File: /etc/pip.conf
[global]
index-url = https://company.example.com/pypi/latestReplace https://company.example.com/pypi/latest with the URL of your PyPI mirror, available in Package Manager on the Setup page of your PyPI repository.
(Optional) Add Python to the system PATH
You can configure Python on the system PATH so that users can use pip within a terminal to install packages to their home directory, similar to how R works with install.packages().
The recommended method to add Python to the PATH is to append the version of Python that you installed to the system-wide PATH variable. For example, define this in a script within the /etc/profile.d/ directory:
cat << EOF | sudo tee /etc/profile.d/python.sh
#!/bin/bash
export PATH=/opt/python/${PYTHON_VERSION}/bin:\$PATH
EOF(Optional) Make Python available as a Jupyter Kernel
For Workbench, you can make the version of Python installed available for use in Jupyter by running these commands:
sudo /opt/python/${PYTHON_VERSION}/bin/python -m pip install ipykernel --break-system-packages --root-user-action=ignore
sudo /opt/python/${PYTHON_VERSION}/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}"(Optional) Install multiple versions of Python
To install multiple versions of Python on the same server, repeat these steps to specify, download, and install a different version of Python alongside existing versions.
Use the System Requirements - Runtime support documentation of the Posit Connect Admin Guide to confirm the minimum Python version supported by Connect. If a configuration file specifies a Python 3 version lower than the minimum supported version, Connect returns an error during startup.
Uninstall
sudo unlink /opt/python/${PYTHON_VERSION}
sudo /usr/local/bin/uv python uninstall --install-dir=/opt/python $PYTHON_VERSIONAdditional information
Refer to the uv Installing Python documentation for more information on installing Python.