When you type python, the configured Python version will be used, if and only if there’s no local version configured. Global usage means that pyenv will use bash magic. To use our newly installed Python version we have two options: I have previously installed python-3.8.3 and created a virtual environment from it. We can list our installed python versions with: pyenv versions. When all the dependencies are met, we can install the desired Python version with: pyenv install 3.9-dev or any other Python version. To list all the available python versions we can run: ➜ ~ pyenv install -līefore installing one, we need to download all the python dependencies for our system, if we don’t do that, the Python compilation will most likely fail.įor a Debian based Linux distro the following command should work: sudo apt-get update sudo apt-get install -no-install-recommends make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-devįor other distros and macOS please refer to: Suggested build environment zshrc in order to have command autocomplete, it also loads pyenv-virtualenv. Note: If you use Zsh you can add pyenv to your plugins in. Please refer to the Installation Instructions. While that’s enough to use Pyenv, I also like to install the pyenv-virtualenv plugin, to manage my Python virtual environments. □įor the full installation instructions and shell auto completion refer to: Installation Basics Then, in order for this to take effect, you need to reload the shell with: source ~/.zshrc, or just restart your terminal. Installing pyenv is pretty straight forward, you’ll need to clone the repo and add the binaries to the path.įor a typical Debian based distro using the Zsh shell the instructions would be: git clone ~/.pyenvĮcho 'export PYENV_ROOT="$HOME/.pyenv"' > ~/.zshrcĮcho 'export PATH="$PYENV_ROOT/bin:$PATH"' > ~/.zshrc In this article I will introduce you to pyenv, a tool for managing python environments.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |