Created
September 7, 2022 03:38
-
-
Save pmarreck/a08fc0915c7545cb11592680bd1363dc to your computer and use it in GitHub Desktop.
An example of installing a Python executable via pip in NixOS, in this case "protonup", using a virtualenv
This file contains hidden or 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 nix-shell | |
#! nix-shell -i bash -p python311 | |
# set this to wherever you want your virtualenv | |
venv="$HOME/.pythonsucks-venv" | |
# set up the venv | |
python -m venv "$venv" | |
# activate the venv | |
source "$venv/bin/activate" | |
# upgrade pip if necessary | |
python -m pip install --upgrade pip | |
# now install whatever you need | |
pip install protonup-ng | |
# optionally, run it | |
protonup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@crftbt I think I wanted to run it as a script but due to all the hand-holding I end up running each line manually. There's probably a better solution at this point.