Reputation: 7
I am writing a python script for an application. The application needs python-mysqldb. In terminal, I can install it with apt-get or pip. How can I install using python script? I am using python 2.7.
Upvotes: 0
Views: 76
Reputation: 224
You could use pip in a python script for installing the package
import pip
if __name__ == '__main__':
pip.main(['install', 'MySQL-python'])
Then you can run the script from a terminal.
Upvotes: 1