Skip to content

Instantly share code, notes, and snippets.

@gamesbrainiac
Created April 27, 2014 18:11
Show Gist options
  • Save gamesbrainiac/11351862 to your computer and use it in GitHub Desktop.
Save gamesbrainiac/11351862 to your computer and use it in GitHub Desktop.
Pip requirements generator
# encoding=utf-8
# FILE INFO #####################################################
# Title : pip requirements generator
# By : Quazi Nafiul Islam <[email protected]>
# Date : 28 Apr 2014
# Made to be used with pycharm Macros
#################################################################
import pip
packages = [str(pkg).replace(' ', '==') for pkg in pip.get_installed_distributions()]
with open('requirements.txt', 'w') as req:
for p in packages:
req.write("{}\n".format(p))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment