Skip to content

Instantly share code, notes, and snippets.

@pmarreck
Created September 7, 2022 03:38
Show Gist options
  • Save pmarreck/a08fc0915c7545cb11592680bd1363dc to your computer and use it in GitHub Desktop.
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
#!/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
@pmarreck
Copy link
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment