Skip to content

muhamien/manage-multiple-python-version

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

Installing pyenv on macOS

Step 1: Update Homebrew and Install pyenv

brew update
brew install pyenv

Alternatively, clone the repository to get the latest version of pyenv

git clone https://github.com/pyenv/pyenv.git ~/.pyenv

Step 2: Define your environment variables

For recent macOS versions, replace ~/.bash_profile with ~/.zshrc as the default shell is Zsh.

echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
source ~/.zshrc

Step 3: Restart your shell so the path changes take effect

exec "$SHELL"

Step 4: Verify the installation and check the available Python versions

pyenv install --list

Step 5: Install the required Python version

pyenv install 3.10

Step 6: Set it as your global version after installation

pyenv global 3.10

Step 7: Update pyenv paths and verify your current Python version

eval "$(pyenv init --path)"
python3 --version

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors