Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
# Step 1:
# Install venv
sudo apt install -y python3-venv
# Step 2:
# Install depedencies
sudo apt-get install -y 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 git
# Step 3:
# Install pyenv
curl https://pyenv.run | bash
# Step 4:
# Copy and past on end of .bashrc
echo 'export PATH="$HOME/.pyenv/bin:$PATH" ' >> ~/.bashrc
echo 'eval "$(pyenv init -)" ' >> ~/.bashrc
echo 'eval "$(pyenv virtualenv-init -)" ' >> ~/.bashrc
# Step 5:
# Update .bashrc
source ~/.bashrc
# Step 6:
# Create new enviromentte
python3 -m venv ~/enviroments/$1
# Step 7:
# activate enviroment
source ~/enviroments/$1/bin/bash/activate
# Step 8:
# Set python version on enviroment
pyenv local 3.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment