Closed ghost closed 8 years ago
The same can be done for system packages:
apt-get install
commandimport apt
cache = apt.Cache()
packages = ["nbtscan", "python-scapy", "tcpdump", "nmap", "ppp", "netdiscover", "macchanger"]
def check_missing_packages():
for package in packages:
print package
try:
if cache[package].is_installed:
continue
except KeyError:
print('%s is NOT installed') % package
check_missing_packages()
Thank you the suggestions. This is something i am looking into and should be done soon.
the above 2 examples will only check for the missing packages not install them correct?
No they will only check them. If you wish to install them I could provide some code, but it is my opinion that the user should be in control and manualy do this. This should not be done in the background.. what do you think?
added both methods for manual and auto installation. thank you
For the python dependencies, I would do two things:
Create a requirements.txt with all the python modules needed. This would enable to provide a single python installer command e.g.
pip install -r requirements.txt
As was already mentioned by @dyzajash , check python modules at runtime e.g.