1

I have seen many GUI applications, when launched, check the system for certain packages and plugins and if they are not there it automatically installs them. How can I do the same with my GUI right before it is launched in python? Can i do it in a .sh script or console script of some sort?

1 Answer 1

1

From https://stackoverflow.com/a/4529027/1413321:

from pkg_resources import WorkingSet , DistributionNotFound
working_set = WorkingSet()

# Printing all installed modules
print tuple(working_set)

# Detecting if module is installed
try:
    dep = working_set.require('paramiko>=1.0')
except DistributionNotFound:
    pass

# Installing it (anyone knows a better way?)
from setuptools.command.easy_install import main as install
install(['django>=1.2'])
Sign up to request clarification or add additional context in comments.

1 Comment

Yes, but can i install some packages other than python modules, for example such as the Qt Qmysql package?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.