dnf install programs works!!
This commit is contained in:
@@ -71,12 +71,16 @@ def install_programs_dnf():
|
|||||||
for line in file:
|
for line in file:
|
||||||
programs.append(line.strip())
|
programs.append(line.strip())
|
||||||
|
|
||||||
|
#for some reason they have to be passed to dnf individually
|
||||||
|
# instead of unpacked list *programs
|
||||||
|
for program in programs:
|
||||||
try:
|
try:
|
||||||
subprocess.check_call(['dnf', 'install', '-y', *programs])
|
subprocess.run(f'dnf install -y {program} ', shell=True)
|
||||||
except:
|
except:
|
||||||
console.print(Exception(),":x:" , style='error')
|
console.print(Exception(),":x:" , style='error')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## pip
|
## pip
|
||||||
def install_pip_modules(modules):
|
def install_pip_modules(modules):
|
||||||
subprocess.check_call(['pip', 'install', *modules])
|
subprocess.check_call(['pip', 'install', *modules])
|
||||||
@@ -86,7 +90,7 @@ def pip_modules(modules):
|
|||||||
for module in modules:
|
for module in modules:
|
||||||
try:
|
try:
|
||||||
importlib.import_module(module)
|
importlib.import_module(module)
|
||||||
except Importerror:
|
except ImportError():
|
||||||
missing_modules.append(module)
|
missing_modules.append(module)
|
||||||
if missing_modules:
|
if missing_modules:
|
||||||
console.print(f"the following modules are missing: {', '.join(missing_modules)}", style='checkt')
|
console.print(f"the following modules are missing: {', '.join(missing_modules)}", style='checkt')
|
||||||
@@ -168,4 +172,4 @@ def executable_scripts():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
install_programs_dnf()
|
||||||
|
|||||||
Reference in New Issue
Block a user