How can I specify optional dependencies in a pip requirements file?
According to the pip documentation this is possible, but the documentation doesn’t explain how to do it, and I can’t find any examples on the web.
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.
Instead of specifying optional dependencies in the same file as the hard requirements, you can create a
optional-requirements.txtand arequirements.txt.To export your current environment’s packages into a text file, you can do this:
If necessary, modify the contents of the requirements.txt to accurately represent your project’s dependencies. Then, to install all the packages in this file, run:
-Utellspipto upgrade packages to the latest version, and-rtells it to install all packages in requirements.txt.