Skip to content

Instantly share code, notes, and snippets.

@0xa
Created October 28, 2019 01:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xa/0ffb2a698acd3852f4b1af83f5c6834d to your computer and use it in GitHub Desktop.
Save 0xa/0ffb2a698acd3852f4b1af83f5c6834d to your computer and use it in GitHub Desktop.
get an usable python3 user environment for poetry on debian buster
# as root
apt install python3 python3-distutils python3-pkg-resources python3-venv
# rest as your project user
su - projectuser
# Create python shims (poetry needs "python" and "pip")
mkdir ~/.local/bin/ -p
ln -s /usr/bin/python3 $HOME/.local/bin/python
ln -s /usr/bin/pip $HOME/.local/bin/pip
echo 'export PATH="$HOME/.local/bin:$PATH"' > ~/.profile && source ~/.profile
# Install poetry
curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
source $HOME/.poetry/env
poetry config settings.virtualenvs.in-project true
# fucking finally an usable environment
cd project && poetry install
# venv is right here in .venv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment