I want to check if a module exists, if it doesn't I want to install it.
How should I do this?
So far I have this code which correctly prints f
if the module doesn't exist.
try:
import keyring
except ImportError:
print 'f'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…