Last active
July 20, 2022 22:46
-
-
Save jtmoon79/081b2509d4d878fd18043979d2e4b22e to your computer and use it in GitHub Desktop.
Python virtualenv create
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# helper to quickly create a Python virtualenv | |
# latest at https://github.com/jtmoon79/dotfiles/blob/master/utilities/venv-create.sh | |
set -eu | |
# XXX: not very portable | |
source /etc/os-release | |
( | |
set -x | |
${PYTHON-python3} --version | |
) | |
V_=${1-".venv-$(${PYTHON-python3} --version | cut -f2 -d ' ')-${ID}-${VERSION_ID}"} | |
path=$(realpath "./${V_}" || true) | |
set -x | |
exec ${PYTHON-python3} -m venv --copies --prompt "${path}" "${path}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment