Skip to content

Instantly share code, notes, and snippets.

@literadix
Last active December 22, 2017 08:57
Show Gist options
  • Save literadix/bd710d5d650489ffa57ca821d1b6f8ce to your computer and use it in GitHub Desktop.
Save literadix/bd710d5d650489ffa57ca821d1b6f8ce to your computer and use it in GitHub Desktop.
import pip
installed_packages = pip.get_installed_distributions()
installed_packages_list = sorted(["%s==%s" % (i.key, i.version)
for i in installed_packages])
print(installed_packages_list)
will print
[
'alembic==0.9.6', 'asn1crypto==0.22.0', 'beautifulsoup4==4.5.3', 'bleach==2.0.0',
'bokeh==0.12.13', 'certifi==2017.7.27.1', 'cffi==1.10.0', 'chardet==3.0.4', 'click==6.7',
'cloudpickle==0.2.2', 'conda==4.3.29', 'cryptography==2.0.3', 'cycler==0.10.0',
'cython==0.25.2', 'dask==0.16.0', 'decorator==4.1.2', 'dill==0.2.6', 'distributed==1.20.2',
'entrypoints==0.2.3', 'fastcache==1.0.2', 'h5py==2.6.0', 'heapdict==1.0.0', 'html5lib==1.0.1',
'idna==2.6', 'ipykernel==4.7.0', 'ipython-genutils==0.2.0', 'ipython==6.2.1', 'ipywidgets==7.0.5',
'jedi==0.10.2', 'jinja2==2.10', 'jsonschema==2.6.0', 'jupyter-client==5.1.0',
'jupyter-core==4.4.0', 'jupyterhub==0.8.1', 'jupyterlab-launcher==0.6.0',
'jupyterlab==0.30.6', 'llvmlite==0.16.0', 'locket==0.2.0', 'mako==1.0.7', 'markupsafe==1.0',
'matplotlib==2.0.2', 'mistune==0.8.3', 'msgpack-python==0.4.8', 'nbconvert==5.3.1', 'nbformat==4.4.0', 'networkx==2.0',
'notebook==5.2.2', 'numba==0.31.0', 'numexpr==2.6.4', 'numpy==1.12.1', 'olefile==0.44', 'pamela==0.3.0', 'pandas==0.19.2',
'pandocfilters==1.4.1', 'partd==0.3.8', 'patsy==0.4.1', 'pexpect==4.3.0', 'pickleshare==0.7.4', 'pillow==4.2.1', 'pip==9.0.1',
'prompt-toolkit==1.0.15', 'protobuf==3.5.0', 'psutil==5.4.0', 'ptyprocess==0.5.2', 'pycosat==0.6.2', 'pycparser==2.18',
'pygments==2.2.0', 'pyopenssl==17.2.0', 'pyparsing==2.2.0', 'pysocks==1.6.7', 'python-dateutil==2.6.1', 'python-editor==1.0.3',
'python-oauth2==1.0.1', 'pytz==2017.3', 'pyyaml==3.12', 'pyzmq==16.0.2', 'requests==2.18.4', 'ruamel-yaml==0.11.14',
'scikit-image==0.12.3', 'scikit-learn==0.18.2', 'scipy==0.19.1', 'seaborn==0.7.1', 'setuptools==36.6.0', 'simplegeneric==0.8.1',
'six==1.11.0', 'sortedcontainers==1.5.7', 'sqlalchemy==1.1.13', 'statsmodels==0.8.0', 'sympy==1.0', 'tblib==1.3.2',
'terminado==0.8.1', 'testpath==0.3.1', 'toolz==0.8.2', 'tornado==4.5.2', 'traitlets==4.3.2', 'urllib3==1.22', 'vincent==0.4.4',
'wcwidth==0.1.7', 'webencodings==0.5', 'wheel==0.30.0', 'widgetsnbextension==3.0.8', 'xlrd==1.1.0', 'zict==0.1.3']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment