3 ms·
> the core language seems to wants all packages installed in /usr. There's also ~/.local/lib/python3/site-packages (or whatever your distribution made of that)
by Denvercoder9 5y ago
> the core language seems to wants all packages installed in /usr.
There's also ~/.local/lib/python3/site-packages (or whatever your distribution made of that). Virtualenvs are only necessary if you want to isolate dependencies between environments. That's useful if you have projects with conflicting dependencies, because Python doesn't allow you to install multiple versions of the same package, for better or worse. However, if you've written some simple scripts that don't care much about the exact version of their dependencies, it's perfectly fine to install their dependencies glboally.
- chriswarbo 5y agoQuick shout-out to nix-shell shebangs, which allow a script to specify exact versions of all dependencies, Python or otherwise, which will be cached into a temporary sandbox. https://nixos.org/manual/nix/stable/#use-as-a-interpreter https://nixos.org/manual/nix/stable/#use-as-a-interpreter I wrote a Python script yesterday which calls out to a couple of external commands (`mlr` and `xq`), with a shebang like this: #!/usr/bin/env nix-shell #!nix-shell -i python3 -p python3 -p miller -p yq