-
Notifications
You must be signed in to change notification settings - Fork 0
Pyenv: Installation
Document Release Date: 1/2/2024
Note: In the I.T. world, applications evolve rapidly. Please report any inaccuracy to papabearcodespython@gmail.com
Pyenv is a python version/flavor installer, that allows you install multiple versions and flavors of python on the same machine.
NOTE: !!!The version/flavor of python available to you will depend highly on the OS you are running.!!!
For example:
- It allows you to have python version 3.9.0 and 3.10.6 installed at the same time. However, only on can be active at the time.
- It allows for plain
python
installations as well asanaconda
There are two different type of python version/flavor selections:
- Locally (Creates a .python-version file in your current directory when activating the python version/flavor)
- Globally (Active for the entire machine)
Pyenv is
_**not officially supported**_
on windows, therefore we are using a fork of Pyenv called pyenv-win
https://github.com/pyenv-win/pyenv-win/blob/master/docs/installation.md#python-pip
You will need to install the package manager
Choco
NOTE: You must have
adminstrator access
to installChoco
- Open a
Powershell' command box with
Adminstrator Access`- Run the following command
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
- If you did not get any errors type:
choco
which will return the version ofChoco
You will need to install the package manager Brew
You will need to execute the following commands
sudo apt update
sudo apt install build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
For other flavor on Linux see this documentation
Run the following command in an ELEVATED ADMINSTRATOR COMMAND LINE!
choco install pyenv-win
Run the following command logged in as the current user that has adminstrator access to your machine!
brew install pyenv
Run the following command in the user home directory.
cd ~
curl https://pyenv.run | bash
echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init --path)"' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bashrc