Junior — Middle
How to install an alternative version of Python that is not used by default on Astre?
sobes.tech AI
Answer from AI
On Astre, to install an alternative version of Python not used by default, you can follow these steps:
- Install the desired Python version alongside the system version (for example, using pyenv if available, or compile from source).
- Ensure that the new version is installed in a separate directory, without replacing the system Python.
- To use the alternative version in specific scripts or sessions, specify the full path to the executable, for example
/usr/local/bin/python3.x. - If necessary, you can create a virtual environment with the required Python version:
/usr/local/bin/python3.x -m venv myenv
source myenv/bin/activate
This way, the system Python remains unchanged, and the alternative version can be used locally or within a virtual environment.