Re:Python and manually creating the requirements.txt vs. pip...
by robinweiss on Wednesday August 17, 2022 @08:57AM
(#32495694)
This ... I don't know what to say :D
I guess I have to thank you, this helps me see the bigger picture and not be too hung up on the manual requirements.txt files of my colleagues. Things truly could be worse.
If you install pex with pipx (or put pex in $PATH another way), you can declare your python script dependencies in the shebang line, like:
Then, you can `chmod +x` your script and call it with "--" between the script name and your arguments, if any: Requests will be installed the first time you run it, then pex should use its cache for subsequent invocations.I wonder if anyone's done this in earnest?