1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/bin/bash set -e # Usage # $ . pip3.sh # $ pip_install [EXECUTABLE_NAME] [PYPI_NAME] pip_install() { server_dir="../servers/$1" [ -d "$server_dir" ] && rm -rf "$server_dir" mkdir "$server_dir" && cd "$server_dir" python3 -m venv ./venv ./venv/bin/pip3 install "$2" ln -s "./venv/bin/$1" . }