From 30a49d3596fba17e81e72f8995eec74506038352 Mon Sep 17 00:00:00 2001 From: Kai KANG Date: Thu, 28 May 2015 13:46:28 +0800 Subject: [PATCH 1/2] Add the cheat sheet for pip. --- cheat/cheatsheets/pip | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 cheat/cheatsheets/pip diff --git a/cheat/cheatsheets/pip b/cheat/cheatsheets/pip new file mode 100644 index 0000000..0894962 --- /dev/null +++ b/cheat/cheatsheets/pip @@ -0,0 +1,17 @@ +# Search for packages +pip search SomePackage + +# Install some packages +pip install SomePackage + +# Show details of a package +pip show SomePackage + +# List outdated packages +pip list --outdated + +# Upgrade all outdated packages, thanks to http://stackoverflow.com/a/3452888 +pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U + +# Install specific version of a package +pip install -I SomePackage1==1.1.0 'SomePackage2>=1.0.4' From b2e1400bb68dd35a20eb1454e072e3bf0fc9bf86 Mon Sep 17 00:00:00 2001 From: Kai KANG Date: Tue, 2 Jun 2015 07:30:34 +0800 Subject: [PATCH 2/2] Update pip: dealing with requirement files add `pip freeze > requirements.txt` and `pip install -r requirements.txt`. --- cheat/cheatsheets/pip | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cheat/cheatsheets/pip b/cheat/cheatsheets/pip index 0894962..edc122c 100644 --- a/cheat/cheatsheets/pip +++ b/cheat/cheatsheets/pip @@ -4,6 +4,10 @@ pip search SomePackage # Install some packages pip install SomePackage +# Output and install packages in a requirement file +pip freeze > requirements.txt +pip install -r requirements.txt + # Show details of a package pip show SomePackage