AllenDowney / ThinkBayes2

Text and code for the forthcoming second edition of Think Bayes, by Allen Downey.
http://allendowney.github.io/ThinkBayes2/
MIT License
1.8k stars 1.49k forks source link

Update conda env #56

Closed jdblischak closed 2 years ago

jdblischak commented 2 years ago

I really enjoyed reading Think Bayes, and I saw your tweet about conda being slow, so I wanted to help out. Please let me know if you'd like me to make any changes, and feel free to close if it isn't helpful.

Background

The biggest change I made was to ignore the defaults channel with nodefaults. At best searching the defaults channel will waste time, and at worst it will pull in defaults packages that are incompatible with conda-forge packages (they are built with different compilers). The only reason to keep defaults in the list is occasionally some packages required for Windows compatibility are only available from defaults (but I confirmed that this wasn't the case).

By listing conda-forge first, this channel is always searched first. The fastai channel is then consulted whenever a package can't be found in the conda-forge channel.

Demonstration

I purposely tested on Windows since this is likely a big motivator for using conda in the first place. mamba installed the environment in under 5 minutes. And this is worst case scenario since it had to index the channels and download all the packages (ie nothing was cached). And I agree with you that conda is unuseable in this situation. I let it spin for ~15 minutes before I just killed it.

# Cleaning up from my previous experiments
conda env remove -n ThinkBayes2
conda clean -ya

mamba --version
## mamba 0.23.0
## conda 4.12.0

# Run from the Anaconda prompt
Time
## The current time is: 11:42:58.56
mamba env create --file environment.yml
Time
## The current time is: 11:47:21.52
conda list -n ThinkBayes2 ``` conda list -n ThinkBayes2 # Name Version Build Channel alabaster 0.7.12 py_0 conda-forge anyio 3.5.0 py310h5588dad_0 conda-forge argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge argon2-cffi-bindings 21.2.0 py310he2412df_2 conda-forge arviz 0.11.1 pyhd8ed1ab_0 conda-forge asttokens 2.0.5 pyhd8ed1ab_0 conda-forge atomicwrites 1.4.0 pyh9f0ad1d_0 conda-forge attrs 21.4.0 pyhd8ed1ab_0 conda-forge babel 2.9.1 pyh44b312d_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge beautifulsoup4 4.11.1 pyha770c72_0 conda-forge bleach 5.0.0 pyhd8ed1ab_0 conda-forge blosc 1.21.1 hcbbf2c4_0 conda-forge brotli 1.0.9 h8ffe710_7 conda-forge brotli-bin 1.0.9 h8ffe710_7 conda-forge brotlipy 0.7.0 py310he2412df_1004 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge ca-certificates 2021.10.8 h5b45459_0 conda-forge cached-property 1.5.2 hd8ed1ab_1 conda-forge cached_property 1.5.2 pyha770c72_1 conda-forge cairo 1.16.0 h15b3021_1010 conda-forge certifi 2021.10.8 py310h5588dad_2 conda-forge cffi 1.15.0 py310hcbf9ad4_0 conda-forge cftime 1.6.0 py310h2873277_1 conda-forge charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge click 7.1.2 pyh9f0ad1d_0 conda-forge click-completion 0.5.2 py310h5588dad_3 conda-forge click-log 0.3.2 pyh9f0ad1d_0 conda-forge colorama 0.4.4 pyh9f0ad1d_0 conda-forge cryptography 36.0.2 py310ha857299_1 conda-forge curl 7.83.0 h789b8ee_0 conda-forge cycler 0.11.0 pyhd8ed1ab_0 conda-forge dataclasses 0.8 pyhc8e2a94_3 conda-forge debugpy 1.6.0 py310h8a704f9_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge docutils 0.15.2 py310h5588dad_3 conda-forge empiricaldist 0.6.3 pypi_0 pypi entrypoints 0.4 pyhd8ed1ab_0 conda-forge executing 0.8.3 pyhd8ed1ab_0 conda-forge expat 2.4.8 h39d44d4_0 conda-forge fastcore 1.4.2 pyhd8ed1ab_0 conda-forge fastdoc 0.0.2 py_0 fastai fastprogress 1.0.2 pyhd8ed1ab_0 conda-forge fastrelease 0.1.16 py_0 fastai flit-core 3.7.1 pyhd8ed1ab_0 conda-forge font-ttf-dejavu-sans-mono 2.37 hab24e00_0 conda-forge font-ttf-inconsolata 3.000 h77eed37_0 conda-forge font-ttf-source-code-pro 2.038 h77eed37_0 conda-forge font-ttf-ubuntu 0.83 hab24e00_0 conda-forge fontconfig 2.14.0 hce3cb01_0 conda-forge fonts-conda-ecosystem 1 0 conda-forge fonts-conda-forge 1 0 conda-forge fonttools 4.33.3 py310he2412df_0 conda-forge freetype 2.10.4 h546665d_1 conda-forge fribidi 1.0.10 h8d14728_0 conda-forge getopt-win32 0.1 h8ffe710_0 conda-forge gettext 0.19.8.1 ha2e2712_1008 conda-forge ghapi 0.1.20 pyhd8ed1ab_0 conda-forge ghp-import 2.1.0 pyhd8ed1ab_0 conda-forge gitdb 4.0.9 pyhd8ed1ab_0 conda-forge gitpython 3.1.27 pyhd8ed1ab_0 conda-forge graphite2 1.3.13 1000 conda-forge graphviz 3.0.0 had6c3a3_1 conda-forge greenlet 1.1.2 py310h8a704f9_2 conda-forge gts 0.7.6 h7c369d9_2 conda-forge h5py 3.6.0 nompi_py310h00cbb18_100 conda-forge harfbuzz 4.2.0 hc1763ed_0 conda-forge hdf4 4.2.15 h0e5069d_3 conda-forge hdf5 1.12.1 nompi_h2a0e4a3_104 conda-forge html5lib 1.1 pyh9f0ad1d_0 conda-forge icu 69.1 h0e60522_0 conda-forge idna 3.3 pyhd8ed1ab_0 conda-forge imagesize 1.3.0 pyhd8ed1ab_0 conda-forge importlib-metadata 4.11.3 py310h5588dad_1 conda-forge importlib_metadata 4.11.3 hd8ed1ab_1 conda-forge importlib_resources 5.7.1 pyhd8ed1ab_0 conda-forge iniconfig 1.1.1 pyh9f0ad1d_0 conda-forge intel-openmp 2022.0.0 h57928b3_3663 conda-forge ipykernel 6.13.0 py310hbbfc1a7_0 conda-forge ipython 8.3.0 py310h5588dad_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge jbig 2.1 h8d14728_2003 conda-forge jedi 0.18.1 py310h5588dad_1 conda-forge jinja2 3.0.3 pyhd8ed1ab_0 conda-forge jpeg 9e h8ffe710_1 conda-forge jsonschema 3.2.0 pyhd8ed1ab_3 conda-forge jupyter 1.0.0 py310h5588dad_7 conda-forge jupyter-book 0.12.3 pyhd8ed1ab_0 conda-forge jupyter-cache 0.4.3 pyhd8ed1ab_0 conda-forge jupyter-server-mathjax 0.2.5 pyhc268e32_0 conda-forge jupyter-sphinx 0.3.2 pyhd8ed1ab_1 conda-forge jupyter_client 6.1.12 pyhd8ed1ab_0 conda-forge jupyter_console 6.4.2 pyhd8ed1ab_0 conda-forge jupyter_contrib_core 0.3.3 py_2 conda-forge jupyter_core 4.9.2 py310h5588dad_0 conda-forge jupyter_nbextensions_configurator 0.4.1 pyhd8ed1ab_2 conda-forge jupyter_server 1.13.5 pyhd8ed1ab_0 conda-forge jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge kiwisolver 1.4.2 py310h476a331_1 conda-forge krb5 1.19.3 h1176d77_0 conda-forge latexcodec 2.0.1 pyh9f0ad1d_0 conda-forge lcms2 2.12 h2a16943_0 conda-forge lerc 3.0 h0e60522_0 conda-forge libblas 3.9.0 14_win64_mkl conda-forge libbrotlicommon 1.0.9 h8ffe710_7 conda-forge libbrotlidec 1.0.9 h8ffe710_7 conda-forge libbrotlienc 1.0.9 h8ffe710_7 conda-forge libcblas 3.9.0 14_win64_mkl conda-forge libclang 13.0.1 default_h81446c8_0 conda-forge libcurl 7.83.0 h789b8ee_0 conda-forge libdeflate 1.10 h8ffe710_0 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libgd 2.3.3 h217ff3b_2 conda-forge libglib 2.70.2 h3be07f2_4 conda-forge libgpuarray 0.7.6 h8ffe710_1003 conda-forge libiconv 1.16 he774522_0 conda-forge liblapack 3.9.0 14_win64_mkl conda-forge libnetcdf 4.8.1 nompi_h1cc8e9d_102 conda-forge libpng 1.6.37 h1d00b33_2 conda-forge libsodium 1.0.18 h8d14728_1 conda-forge libssh2 1.10.0 h680486a_2 conda-forge libtiff 4.3.0 hc4061b1_3 conda-forge libwebp 1.2.2 h57928b3_0 conda-forge libwebp-base 1.2.2 h8ffe710_1 conda-forge libxcb 1.13 hcd874cb_1004 conda-forge libxml2 2.9.14 hf5bbc77_0 conda-forge libxslt 1.1.33 h34f844d_4 conda-forge libzip 1.8.0 hfed4ece_1 conda-forge libzlib 1.2.11 h8ffe710_1014 conda-forge linkify-it-py 1.0.3 pyhd8ed1ab_0 conda-forge lxml 4.8.0 py310he2412df_3 conda-forge lz4-c 1.9.3 h8ffe710_1 conda-forge m2w64-gcc-libgfortran 5.3.0 6 conda-forge m2w64-gcc-libs 5.3.0 7 conda-forge m2w64-gcc-libs-core 5.3.0 7 conda-forge m2w64-gmp 6.1.0 2 conda-forge m2w64-libwinpthread-git 5.0.0.4634.697f757 2 conda-forge mako 1.2.0 pyhd8ed1ab_1 conda-forge markdown-it-py 1.1.0 pyhd8ed1ab_0 conda-forge markupsafe 2.1.1 py310he2412df_1 conda-forge matplotlib 3.5.2 py310h5588dad_0 conda-forge matplotlib-base 3.5.2 py310h79a7439_0 conda-forge matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge mdit-py-plugins 0.2.8 pyhd8ed1ab_0 conda-forge mistune 0.8.4 py310he2412df_1005 conda-forge mkl 2022.0.0 h0e2418a_796 conda-forge mkl-service 2.4.0 py310h3d5ec83_0 conda-forge msys2-conda-epoch 20160418 1 conda-forge munkres 1.1.4 pyh9f0ad1d_0 conda-forge myst-nb 0.13.2 pyhd8ed1ab_0 conda-forge myst-parser 0.15.2 pyhd8ed1ab_0 conda-forge nbclient 0.5.13 pyhd8ed1ab_0 conda-forge nbconvert 5.6.1 pyhd8ed1ab_2 conda-forge nbdev 1.1.23 py_0 fastai nbdime 3.1.1 pyhd8ed1ab_0 conda-forge nbformat 5.4.0 pyhd8ed1ab_0 conda-forge nbmake 1.3.0 pyhd8ed1ab_1 conda-forge nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge netcdf4 1.5.8 nompi_py310h5489b47_101 conda-forge notebook 6.4.11 pyha770c72_0 conda-forge numexpr 2.7.3 py310hf5e1058_2 conda-forge numpy 1.22.3 py310hed7ac4c_2 conda-forge openjpeg 2.4.0 hb211442_1 conda-forge openssl 1.1.1o h8ffe710_0 conda-forge packaging 21.3 pyhd8ed1ab_0 conda-forge pandas 1.4.2 py310hf5e1058_1 conda-forge pandoc 2.2.2 hde52d81_1 conda-forge pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge pango 1.50.7 h66df5b2_0 conda-forge parso 0.8.3 pyhd8ed1ab_0 conda-forge patsy 0.5.2 pyhd8ed1ab_0 conda-forge pcre 8.45 h0e60522_0 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 9.1.0 py310h767b3fd_2 conda-forge pip 22.0.4 pyhd8ed1ab_0 conda-forge pixman 0.40.0 h8ffe710_0 conda-forge pluggy 1.0.0 py310h5588dad_3 conda-forge prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.29 pyha770c72_0 conda-forge prompt_toolkit 3.0.29 hd8ed1ab_0 conda-forge psutil 5.9.0 py310he2412df_1 conda-forge pthread-stubs 0.4 hcd874cb_1001 conda-forge pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge py 1.11.0 pyh6c4a22f_0 conda-forge pybtex 0.24.0 pyhd8ed1ab_2 conda-forge pybtex-docutils 1.0.1 py310h5588dad_1 conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pydantic 1.9.0 py310he2412df_1 conda-forge pydata-sphinx-theme 0.7.2 pyhd8ed1ab_0 conda-forge pygments 2.12.0 pyhd8ed1ab_0 conda-forge pygpu 0.7.6 py310h2873277_1003 conda-forge pymc3 3.9.3 pyhd8ed1ab_3 conda-forge pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.8 pyhd8ed1ab_0 conda-forge pyqt 5.12.3 py310h5588dad_8 conda-forge pyqt-impl 5.12.3 py310h8a704f9_8 conda-forge pyqt5-sip 4.19.18 py310h8a704f9_8 conda-forge pyqtchart 5.12 py310h8a704f9_8 conda-forge pyqtwebengine 5.12.1 py310h8a704f9_8 conda-forge pyrsistent 0.18.1 py310he2412df_1 conda-forge pysocks 1.7.1 py310h5588dad_5 conda-forge pytables 3.7.0 py310h5dd77a3_0 conda-forge pytest 7.1.2 py310h5588dad_0 conda-forge python 3.10.4 h9a09f29_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge python-graphviz 0.20 pyhaef67bd_0 conda-forge python_abi 3.10 2_cp310 conda-forge pytz 2022.1 pyhd8ed1ab_0 conda-forge pywin32 303 py310he2412df_0 conda-forge pywinpty 2.0.5 py310h00ffb61_1 conda-forge pyyaml 6.0 py310he2412df_4 conda-forge pyzmq 22.3.0 py310h73ada01_2 conda-forge qt 5.12.9 h556501e_6 conda-forge qtconsole 5.3.0 pyhd8ed1ab_0 conda-forge qtconsole-base 5.3.0 pyhd8ed1ab_0 conda-forge qtpy 2.1.0 pyhd8ed1ab_0 conda-forge requests 2.27.1 pyhd8ed1ab_0 conda-forge scipy 1.8.0 py310h33db832_1 conda-forge seaborn 0.11.2 hd8ed1ab_0 conda-forge seaborn-base 0.11.2 pyhd8ed1ab_0 conda-forge send2trash 1.8.0 pyhd8ed1ab_0 conda-forge setuptools 62.1.0 py310h5588dad_0 conda-forge shellingham 1.4.0 pyh44b312d_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge smmap 3.0.5 pyh44b312d_0 conda-forge snappy 1.1.8 ha925a31_3 conda-forge sniffio 1.2.0 py310h5588dad_3 conda-forge snowballstemmer 2.2.0 pyhd8ed1ab_0 conda-forge soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge sphinx 4.5.0 pyh6c4a22f_0 conda-forge sphinx-book-theme 0.1.9 pyhd8ed1ab_0 conda-forge sphinx-comments 0.0.3 pyh9f0ad1d_0 conda-forge sphinx-copybutton 0.5.0 pyhd8ed1ab_0 conda-forge sphinx-external-toc 0.2.3 pyhd8ed1ab_0 conda-forge sphinx-jupyterbook-latex 0.4.6 pyhd8ed1ab_0 conda-forge sphinx-multitoc-numbering 0.1.3 pyhd8ed1ab_0 conda-forge sphinx-panels 0.6.0 pyhd8ed1ab_0 conda-forge sphinx-thebe 0.1.2 pyhd8ed1ab_0 conda-forge sphinx-togglebutton 0.3.1 pyhd8ed1ab_0 conda-forge sphinxcontrib-applehelp 1.0.2 py_0 conda-forge sphinxcontrib-bibtex 2.4.2 pyhd8ed1ab_0 conda-forge sphinxcontrib-devhelp 1.0.2 py_0 conda-forge sphinxcontrib-htmlhelp 2.0.0 pyhd8ed1ab_0 conda-forge sphinxcontrib-jsmath 1.0.1 py_0 conda-forge sphinxcontrib-qthelp 1.0.3 py_0 conda-forge sphinxcontrib-serializinghtml 1.1.5 pyhd8ed1ab_2 conda-forge sqlalchemy 1.4.36 py310he2412df_0 conda-forge sqlite 3.38.3 h8ffe710_0 conda-forge stack_data 0.2.0 pyhd8ed1ab_0 conda-forge statsmodels 0.13.2 py310h2873277_0 conda-forge tbb 2021.5.0 h2d74725_1 conda-forge terminado 0.13.3 py310h5588dad_1 conda-forge testpath 0.6.0 pyhd8ed1ab_0 conda-forge theano 1.0.5 py310h8a704f9_3 conda-forge tk 8.6.12 h8ffe710_0 conda-forge tomli 2.0.1 pyhd8ed1ab_0 conda-forge tornado 6.1 py310he2412df_3 conda-forge tqdm 4.64.0 pyhd8ed1ab_0 conda-forge traitlets 5.1.1 pyhd8ed1ab_0 conda-forge typing-extensions 3.10.0.2 hd8ed1ab_0 conda-forge typing_extensions 3.10.0.2 pyha770c72_0 conda-forge tzdata 2022a h191b570_0 conda-forge uc-micro-py 1.0.1 pyhd8ed1ab_0 conda-forge ucrt 10.0.20348.0 h57928b3_0 conda-forge unicodedata2 14.0.0 py310he2412df_1 conda-forge urllib3 1.26.9 pyhd8ed1ab_0 conda-forge vc 14.2 hb210afc_6 conda-forge vs2015_runtime 14.29.30037 h902a5da_6 conda-forge vs2017_win-64 19.16.27033 hb90652a_6 conda-forge vswhere 3.0.2 h57928b3_0 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge websocket-client 1.3.2 pyhd8ed1ab_0 conda-forge wheel 0.37.1 pyhd8ed1ab_0 conda-forge widgetsnbextension 3.6.0 py310h5588dad_0 conda-forge win_inet_pton 1.1.0 py310h5588dad_4 conda-forge winpty 0.4.3 4 conda-forge xarray 2022.3.0 pyhd8ed1ab_0 conda-forge xlrd 2.0.1 pyhd8ed1ab_3 conda-forge xorg-kbproto 1.0.7 hcd874cb_1002 conda-forge xorg-libice 1.0.10 hcd874cb_0 conda-forge xorg-libsm 1.2.3 hcd874cb_1000 conda-forge xorg-libx11 1.7.2 hcd874cb_0 conda-forge xorg-libxau 1.0.9 hcd874cb_0 conda-forge xorg-libxdmcp 1.1.3 hcd874cb_0 conda-forge xorg-libxext 1.3.4 hcd874cb_1 conda-forge xorg-libxpm 3.5.13 hcd874cb_0 conda-forge xorg-libxt 1.2.1 hcd874cb_2 conda-forge xorg-xextproto 7.3.0 hcd874cb_1002 conda-forge xorg-xproto 7.0.31 hcd874cb_1007 conda-forge xz 5.2.5 h62dcd97_1 conda-forge yaml 0.2.5 h8ffe710_2 conda-forge zeromq 4.3.4 h0e60522_1 conda-forge zipp 3.8.0 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h8ffe710_1014 conda-forge zstd 1.5.2 h6255e5f_0 conda-forge ```

Other ideas

AllenDowney commented 2 years ago

@jdblischak Thank you very much, this is extremely helpful.

Splitting the environment is a good idea -- I will get on that.

empyrical-dist was a precursor of what became empiricaldist. It is super obsolete at this point.

And yes, if you can make empiricaldist available from conda-forge, that would be great!

jdblischak commented 2 years ago

Thank you very much, this is extremely helpful.

It's the least I could do. Thanks for the quick merge!

And yes, if you can make empiricaldist available from conda-forge, that would be great!

I opened a PR https://github.com/conda-forge/staged-recipes/pull/18851 to submit empiricaldist to conda-forge