You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide shortly describes how to install the pyenv virtual environment manager.
Pyenv is only officially supported on Linux/MacOS systems, so we will focus on these OS environments.
In addition, we will install pyenv-virtualenv. This is a pyenv plugin for creating and managing virtual Python environments.
Prerequisites
Homebrew
This guide assumes that you have installed homebrew.
MacOS: Xcode dependencies
On MacOS: install Xcode dependencies:
Xcode-select --install
Installing pyenv
Install pyenv using homebrew:
brew upgrade
brew install pyenv
Install extra libraries:
brew install readline xz
Install virtualenv using homebrew:
brew install pyenv-virtualenv
Getting Started
The following command installs Python 3.11.7 in pyenv:
pyenv install 3.11.7
Since we don't want to use an installed Python version directly, we will create a new virtual environment, e.g. taking version 3.11.7 as a base version. The following command will create a virtual environment acme-3.11:
pyenv virtualenv 3.11.7 acme-3.11
We can now enable a virtual environment for the local directory:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This guide shortly describes how to install the pyenv virtual environment manager.
Pyenv is only officially supported on Linux/MacOS systems, so we will focus on these OS environments.
In addition, we will install pyenv-virtualenv. This is a pyenv plugin for creating and managing virtual Python environments.
Prerequisites
Homebrew
This guide assumes that you have installed homebrew.
MacOS: Xcode dependencies
On MacOS: install Xcode dependencies:
Installing pyenv
Install pyenv using homebrew:
Install extra libraries:
Install virtualenv using homebrew:
Getting Started
The following command installs Python 3.11.7 in pyenv:
Since we don't want to use an installed Python version directly, we will create a new virtual environment, e.g. taking version 3.11.7 as a base version. The following command will create a virtual environment acme-3.11:
We can now enable a virtual environment for the local directory:
Beta Was this translation helpful? Give feedback.
All reactions