This blog post is a collection of Python tips and tricks that I have found useful over the years. I will keep updating this entry as I learn more.
-
How to add a custom CA Root certificate to the CA Store used by pip in Windows?
pip config set global.cert path/to/ca-bundle.crt pip config list
-
Generate requiements.txt
Usepipreqs
pip install pipreqs pipreqs /path/to/project
or
pip freeze
. But, freeze saves all packages in the environment including those that you don“t use in your current project!pip freeze
-
Use a alternative repo for downloading packages
pip config set global.index-url https://repo.company.com/artifactory/api/pypi/python.pypi.proxy/simple pip config list