What’s the correct process to install and run a .py application and its dependencies? Where should I save the .py file, where should I run it from, and can it interfere with the rest of my system?
Often there is an application/script I’d like to use and it is provided as a .py file download, along with a list of other applications/scripts that need to be installed separately for it to work. Often not all of these dependencies are available in my distro’s repository. There seems to be an assumption of prior knowledge as to how to get set up to run .py files, and it is therefore not documented on developers pages. Can anyone fill me in?
I’d like to install this application. Perhaps it could be used as an example to help explain the process.
My distro is Debian 13, in case that’s relevant.
Thanks!


Hey when pip doesn’t work:
You’re using Debian, so if you don’t want to set up virtual environments the best bet is to install your dependencies using apt like a normal person. All the python stuff in apt will show up under the prefix python3-. So you’ll need python3-numpy, python3-tiffile etc.
Apt supports tab completion so something like “apt install python3-num” then the tab key would show a list of possible completions (and jump forward any letters that are common between completions).
If you want to use venvs there’s a bunch of posts explaining how to do that.
When you want to “install” the .py doohicky you just downloaded, put it in your path! $PATH will tell you what locations get scanned for executable files when you type something and you can add a local directory like ~/.bin to it, then put your .py file in there. If you go with venvs, put the .py file in the right place to run inside the venv, then make a one liner script that runs it from the venv with the file name set to what you wanna type to run the .py, put it in your local path directory and you’re off to the races!
I also use Debian and am coerced into using python software so reply with any questions and I’ll set you straight.
Thanks for the help! For some reason tab autocompletion doesn’t work for me but that’s an issue for another day…
This could be where I’ve been getting lost. How do I figure out what the right place is?
One man’s right place is another man’s evidence of clinical insanity. You could just leave them on your desktop and invoke them through the venv. You could make a folder called Folder For Python Scripts That Don’t Run Good and put all your different python things there.
You can also put the target python script inside the folder its respective venv lives in.
Really the world is your oyster because ultimately you’re gonna make another script that does something like “read $a; ~./<venv_location>/python3 <target_.py_file> $a;” and naming it what you wanna type to run your .py and put it in your local $PATH directory.
Don’t trust that one liner btw it’s definitley wrong.