packages to make a script work?
For example:
My script needs numpy
How do I check if numpy is installed, and if not, my script automatically installs it?
>my script automatically installs it Nonononono. Look up 'requirements.txt python'
try: import numpy except ModuleNotFoundError: ...
... => from os import system ; system("pip install numpy")
But I need to install and import that after the install, is it possible to do so?
try: import numpy except ModuleNotFoundError: from os import system system("pip install numpy") import numpy
like he said better use requirements.txt
It's just for personal use so idc about confirmation 😜
Обсуждают сегодня