A Python script that I wrote (one .py file) depends on the requests module, however the target machine does not have requests installed. How can I package the two together? The target machine is a CentOS Linux box.
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.
Use a
distutils-based setup script, then install withpiporeasy_install.That way you can specify
requestsas a dependency and it’ll be installed together with your script:See Declaring Dependencies and the Python Packaging User Guide for more information.
If for whatever reason you cannot use this infrastructure, just unpack the
requeststarball next to your script, and add the parent directory of your script tosys.path: