Compare two Python distributions

Links: notebook, html, PDF, python, slides, GitHub

Compares two files or strings. It is used to compare the outputs of pip freeze from two different python distributions.

from jyquickhelper import add_notebook_menu
add_notebook_menu()

preparation

%load_ext pyquickhelper

home distribution

dist1 = !pip freeze
dist1[:3]
['WARNING: Could not generate requirement for distribution -illow 5.4.1 (c:\python372_x64\lib\site-packages): Parse error at "'-illow=='": Expected W:(abcd...)',
 'absl-py==0.7.1',
 'adal==1.2.1']
dist1 = "\n".join(dist1)

other distribution

dist2 = """
alabaster==0.7.9
antlr4-python3-runtime==4.5.3
appdirs==1.4.0
autopep8==1.2.4
autopy3==0.51.1
azure-nspkg==1.0.0
azure-servicebus==0.20.2
azure-servicemanagement-legacy==0.20.3
azure-storage==0.32.0
Babel==2.3.4
backports-abc==0.4
backports.shutil-get-terminal-size==1.0.0
basemap==1.0.8
bayespy==0.5.1
bcolz==1.1.0
beautifulsoup4==4.5.1
biopython==1.67
blaze==0.10.1
bokeh==0.12.1
bqplot==0.7.1
brewer2mpl==1.4.1
brythonmagic==0.2.1
certifi==2016.8.8
cffi==1.7.0
chardet==2.3.0
click==6.6
cloud-sptheme==1.7.1
cloudpickle==0.2.1
cobble==0.1.1
codecov==2.0.5
colorama==0.3.7
colorlover==0.2.1
colormap==0.9.8
coverage==4.2
cryptography==1.4
cufflinks==0.8.2
cvxopt==1.1.7
cycler==0.10.0
Cython==0.24.1
cytoolz==0.8.0
dask==0.10.2
datashader==0.2.0
datashape==0.5.2
dbfread==2.0.6
decorator==4.0.10
dill==0.2.5
docopt==0.6.2
docutils==0.12
easydev==0.9.25
ecdsa==0.13
entrypoints==0.2.2
enum34==1.1.2
ete3==3.0.0b35
falcon==1.0.0
feedparser==5.2.1
flake8==3.0.4
Flask==0.11.1
Flask-Cors==2.1.2
folium==0.2.1
foundation-sphinx-theme==0.0.3
future==0.15.2
gdbn==0.1
geoplotlib==0.3.2
ggplot==0.11.1
gnumpy==0.2
gplearn==0.1.0
gprof2dot==2015.12.1
graphviz==0.4.10
h2o==3.8.3.3
h5py==2.6.0
hachibee-sphinx-theme==0.2.5
husl==4.0.3
idna==2.1
imagesize==0.7.1
ipykernel==4.4.1
ipython==5.0.0
ipython-genutils==0.1.0
ipywidgets==5.2.2
isodate==0.5.4
itsdangerous==0.24
jdcal==1.2
Jinja2==2.8
joblib==0.10.0
JSAnimation==0.1
jsonschema==2.5.1
jupyter==1.0.0
jupyter-client==4.3.0
jupyter-console==5.0.0
jupyter-contrib-core==0.2.0
jupyter-core==4.1.1
jupyter-nbextensions-configurator==0.2.0
jupyter-pip==0.3
keyring==9.3.1
leather==0.2.0
lifelines==0.9.2
lightning-python==1.2.1
line-profiler==1.0
llvmlite==0.12.1
locket==0.2.0
lxml==3.6.1
Mako==1.0.4
mammoth==1.1.1
MarkupSafe==0.23
matplotlib==1.5.1
mccabe==0.5.2
memory-profiler==0.41
metakernel==0.13.5
missingno==0.2.4
mistune==0.7.3
mlxtend==0.4.1
mpld3==0.2
mpmath==0.19
msrest==0.1.1
msrestazure==0.1.1
multi-key-dict==2.0.3
multipledispatch==0.4.8
natgrid==0.2.1
natsort==5.0.1
nbconvert==4.2.0
nbformat==4.1.0
netCDF4==1.2.4
networkx==1.11
nolearn==0.5
nose==1.3.7
notebook==4.2.2
notedown==1.5.0
numba==0.27.0
numpy==1.11.1+mkl
oauthlib==1.1.2
odo==0.5.0
onedrivesdk==1.0.9
opencv-python==3.1.0
openpyxl==2.3.5
ordereddict==1.1
pandas==0.18.1
pandas-datareader==0.2.1
pandoc-attributes==0.1.7
pandocfilters==1.3.0
paramiko==2.0.2
parsimonious==0.6.2
partd==0.3.5
path.py==8.2.1
patsy==0.4.1
pbr==1.10.0
pep8==1.7.0
pickleshare==0.7.3
Pillow==3.3.0
pipdeptree==0.6.0
plotly==1.12.6
prettytable==0.7.2
prompt-toolkit==1.0.5
psutil==4.3.0
psycopg2==2.6.2
py==1.4.31
py-earth==0.1.0
py2exe==0.9.2.2
pyasn1==0.1.9
pycallgraph==1.0.1
pycodestyle==2.0.0
pycparser==2.14
pycrypto==2.7a2
pycryptodomex==3.4.2
pydub==0.16.5
pydy==0.3.1
pyflakes==1.2.3
pygal==2.2.3
pygal-maps-fr==1.1.0
pygame==1.9.2a0
pyglet==1.2.4
Pygments==2.1.3
pyinstrument==0.13.1
pylzma==0.4.8
pyparsing==2.1.7
pyPdf==1.13
pypiserver==1.2.0
pypiwin32==219
pyprofiler==69
PyQt4==4.11.4
pyreadline==2.1
pyshp==1.2.3
pytest==2.9.2
Python-contrib-nbextensions===alpha
python-dateutil==2.5.3
python-jenkins==0.4.13
python-linkedin==4.1
python-mimeparse==1.5.2
pythreejs==0.2.1
pytz==2016.6.1
pywin32-ctypes==0.0.1
PyXB==1.2.4
PyYAML==3.11
pyzmq==15.3.0
qgrid==0.3.2
qtconsole==4.2.1
reportlab==3.3.0
requests==2.11.0
requests-file==1.4
requests-oauthlib==0.6.2
rpy2==2.8.1
sacred==0.6.10
scikit-image==0.12.3
scikit-learn==0.17.1
scipy==0.18.0
seaborn==0.7.1
selenium==2.53.6
simplegeneric==0.8.1
six==1.10.0
sklearn-contrib-lightning==0.3.0
sklearn-pandas==1.1.0
sklearn-pmml==0.1.2
skll==1.2.1
smopy==0.0.6
snakeviz==0.4.1
snowballstemmer==1.2.1
solar-theme==1.3.2
Sphinx==1.4.5
sphinx-bootstrap-theme==0.4.12
sphinx-gallery==0.1.3
sphinx-py3doc-enhanced-theme==2.3.2
sphinx-readable-theme==1.3.0
sphinx-rtd-theme==0.1.9
sphinx-theme-pd==0.0.8
sphinxcontrib-images==0.7.0
sphinxcontrib-imagesvg==0.1
sphinxcontrib-lunrsearch==0.2
sphinxjp.themes.basicstrap==0.4.3
sphinxjp.themes.revealjs==0.3.0
sphinxjp.themes.sphinxjp==0.3.1
splinter==0.7.4
SQLAlchemy==1.0.14
statsmodels==0.6.1
sympy==1.0
tabulate==0.7.5
toolz==0.8.0
tornado==4.4.1
traitlets==4.2.2
tutormagic==0.2.0
ujson==1.35
urllib3==1.16
vega==0.4.2
version-information==1.0.3
virtualenv==15.0.3
vprof==0.32
wcwidth==0.1.7
Werkzeug==0.11.10
widgetsnbextension==1.2.6
wild-sphinx-theme==1.0.0
win-unicode-console==0.5
winrandom==1.2
winshell==0.6
wrapt==1.10.8
xarray==0.8.1
xgboost==0.6
xlrd==1.0.0
xray==0.7.0
"""

comparison

%textdiff dist1 dist2
populating...
<IPython.core.display.Javascript object>