Install & Create
Install
Install python with pyenv.
sudo apt update; sudo apt install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev curl git \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-devcurl -fsSL https://pyenv.run | bashecho 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrcsource ~/.bashrcList available versions to install
pyenv install -lInstall a version
pyenv install <version>Set global version
pyenv global <version>Check global version
Creating a Project
Virtual Environement
You can create projects with a package.json alike way, with venv.
When using Virtual Environments, dependencies installed via pip will be installed at a project scope, instead of globally.
Create the environment
Active the environment
Deactivate
Create requirements.txt
This file will act like a package.json, saving the dependencies.
To reinstall from a requirements.txt
Will have to recreate the environment first.
Last updated