how, inside a python script can I install packages using pip?
I don’t use the os.system, I want to import pip and use it.
how, inside a python script can I install packages using pip? I don’t use
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s not a good idea to install packages inside the python script because it requires root rights. You should ship additional modules alongside with the script you created or check if the module is installed:
If you insist in installing the package using pip inside your script you’ll have to look into
callfrom thesubprocessmodule (“os.system()” is deprecated).There is no pip module but you could easily create one using the method above.