You shouldnt install python dependencies system wide, recent distros block running pip outside a virtual environment. Use pipx, it automates everything: https://pipx.pypa.io/
Programming
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities [email protected]
It creates a venv in the script directory and installs the dependencies that way.
yeah that should just be a pip package instead, then install it any normal way
Use dotfiles; ~/.local/script_dir/
Frankly, this is what pipx is for.
Sounds like it could be published as a PyPI package, then used with uvx or pipx.
If I made this a PyPi package, would I be able to create a config file to read from it/have it read from a default config file and set that as the user config file?
sure, you can store the config in $XDG_CONFIG_HOME/your-app-name/ (the var usually defaults to ~/.config/).
Somehow nobody has mentioned that the executable script should reside in a location listed in the users path.
Add shebang Download to /usr/local/bin/ or at least symlink there.
Maybe package as pip package
Read a standard sometime people.
https://en.m.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
OP wrote they want to install dependencies as well, that's why it's a bit more complex situation. For python scripts without external dependencies it would work.
This is hard to say without knowing the use of the scripts. If it's something to be used as normal CLI tools, probably some place that's in the user's path. If it's something else, I would just have it download to the current working directory so that the user has the choice on where to put it.
Updated the post to include more info, but it is a CLI app which helps simplify yt-dlp commands. It doesn't mess with any system files.
Yeah, I would create a directory in the current working directory and put it there.