[Python] How to automatically install required packages from a Python script as necessary?

Discussão em 'Python' iniciado por Stack, Janeiro 26, 2025.

  1. Stack

    Stack Membro Participativo

    Is there anything in Python or Linux what basically instructs the system to "install whatever is necessary". Basically I find it annoying to install python packages for each new script/system/server that I work on. Each time I end up doing a sudo pip or an apt-get or dnf anyway. Why not automate that within the script itself. Wherever a 'no package found' error crops up, pass the library name to the install statement. Is this there ?

    PS: I know docker exists, but am talking at a Python/script level or a direct system level for purely execution purposes.

    Continue reading...

Compartilhe esta Página