Creating a conda virtual environment that conforms to an old version of Anaconda

I am trying to find a way to install a second version of Anaconda (with all the associated packages) or alternatively create an virtual environment that exactly conforms to an old version of Anaconda (specifically Anaconda 4.2 / python 3.5).

Context: While I am personally working on a relative up to date version of Anaconda (2021.05), I am doing a workshop for a company that still works on Anaconda 4.2. To ease the creation of the workshop, I would like to code some exemplary code in jupyter notebook with the exact base environment of Anaconda 4.2. However, I seem to be unable to set up such an virtual environment without running in all kinds of compatibility issues. I feel like there has to be an easier way than reinstalling Anaconda every time I switch projects or alternatively to use conda and pip jointly to hack together a bunch of relevant packages in the correct versions (which currently always results in compatibility issues). Asking the company to move to a newer version is not really an option.

Some more details: My main issue stems from the lack of old versions of pandas, numpy, matplotlib, and scikit learn in the default channels of anaconda, forcing me to install those versions with pip, which then results in compatibility issues.

Answer

For anaconda 5.0, there was a change in recipes/compilers and all packages that were available prior to that change are now in the free channel, which is not in the defaults to increase the speed of conda.

Since you want to have a rather old version of anaconda, you will need to add it. In order to get all packages that came alongside anaconda-4.2.0, you can simply use the anaconda metapackage. I.e. to create an environment that corresponds to anaconda 4.2, simply do:

conda create -c free -n anaconda42 anaconda=4.2.0

which correctly installs these packages:

The following packages will be downloaded:
package                    |            build
---------------------------|-----------------
_license-1.1               |           py35_1          56 KB  free
_nb_ext_conf-0.3.0         |           py35_0          929 B  free
alabaster-0.7.9            |           py35_0          11 KB  free
anaconda-4.2.0             |      np111py35_0          16 KB  free
anaconda-clean-1.0.0       |           py35_0          42 KB  free
anaconda-client-1.5.1      |           py35_0         166 KB  free
anaconda-navigator-1.3.1   |           py35_0         3.1 MB  free
argcomplete-1.0.0          |           py35_1          84 KB  free
astroid-1.4.7              |           py35_0         258 KB  free
astropy-1.2.1              |      np111py35_0         6.1 MB  free
babel-2.3.4                |           py35_0         4.8 MB  free
backports-1.0              |           py35_0           1 KB  free
beautifulsoup4-4.5.1       |           py35_0         125 KB  free
bitarray-0.8.1             |           py35_1          57 KB  free
blas-1.0                   |              mkl           6 KB  free
blaze-0.10.1               |           py35_0         622 KB  free
bokeh-0.12.2               |           py35_0         3.4 MB  free
boto-2.42.0                |           py35_0         1.5 MB  free
bottleneck-1.1.0           |      np111py35_0         191 KB  free
cffi-1.7.0                 |           py35_0         130 KB  free
chest-0.2.3                |           py35_0           5 KB  free
click-6.6                  |           py35_0         100 KB  free
cloudpickle-0.2.1          |           py35_0          17 KB  free
clyent-1.2.2               |           py35_0          15 KB  free
colorama-0.3.7             |           py35_0          19 KB  free
comtypes-1.1.2             |           py35_0         220 KB  free
configobj-5.0.6            |           py35_0          28 KB  free
console_shortcut-0.1.1     |           py35_1          47 KB  free
contextlib2-0.5.3          |           py35_0          12 KB  free
cryptography-1.5           |           py35_0         331 KB  free
curl-7.49.0                |           vc14_0         305 KB  free
cython-0.24.1              |           py35_0         2.2 MB  free
cytoolz-0.8.0              |           py35_0         243 KB  free
dask-0.11.0                |           py35_0         624 KB  free
datashape-0.5.2            |           py35_0          94 KB  free
decorator-4.0.10           |           py35_0          12 KB  free
dill-0.2.5                 |           py35_0          75 KB  free
docutils-0.12              |           py35_2         674 KB  free
dynd-python-0.7.2          |           py35_0         435 KB  free
entrypoints-0.2.2          |           py35_0           6 KB  free
et_xmlfile-1.0.1           |           py35_0          15 KB  free
fastcache-1.0.2            |           py35_1          27 KB  free
filelock-2.0.6             |           py35_0           8 KB  free
flask-0.11.1               |           py35_0         139 KB  free
flask-cors-2.1.2           |           py35_0          16 KB  free
freetype-2.5.5             |           vc14_1         621 KB  free
get_terminal_size-1.0.0    |           py35_0           4 KB  free
gevent-1.1.2               |           py35_0         471 KB  free
greenlet-0.4.10            |           py35_0          16 KB  free
h5py-2.6.0                 |      np111py35_2         656 KB  free
hdf5-1.8.15.1              |           vc14_4         1.5 MB  free
heapdict-1.0.0             |           py35_1           5 KB  free
icu-57.1                   |           vc14_0        34.2 MB  free
idna-2.1                   |           py35_0         115 KB  free
imagesize-0.7.1            |           py35_0           3 KB  free
ipykernel-4.5.0            |           py35_0         126 KB  free
ipython-5.1.0              |           py35_0         1.0 MB  free
ipython_genutils-0.1.0     |           py35_0          33 KB  free
ipywidgets-5.2.2           |           py35_0          59 KB  free
itsdangerous-0.24          |           py35_0           8 KB  free
jdcal-1.2                  |           py35_1           9 KB  free
jedi-0.9.0                 |           py35_1         195 KB  free
jinja2-2.8                 |           py35_1         300 KB  free
jsonschema-2.5.1           |           py35_0          97 KB  free
jupyter-1.0.0              |           py35_3           3 KB  free
jupyter_client-4.4.0       |           py35_0         141 KB  free
jupyter_console-5.0.0      |           py35_0          69 KB  free
jupyter_core-4.2.0         |           py35_0         104 KB  free
lazy-object-proxy-1.2.1    |           py35_0          27 KB  free
libdynd-0.7.2              |                0         3.9 MB  free
libpng-1.6.22              |           vc14_0         547 KB  free
llvmlite-0.13.0            |           py35_0         6.2 MB  free
locket-0.2.0               |           py35_1           6 KB  free
lxml-3.6.4                 |           py35_0         1.6 MB  free
markupsafe-0.23            |           py35_2          28 KB  free
matplotlib-1.5.3           |      np111py35_0         6.2 MB  free
menuinst-1.4.1             |           py35_0         107 KB  free
mistune-0.7.3              |           py35_0         131 KB  free
mkl-11.3.3                 |                1       110.0 MB  free
mkl-service-1.1.2          |           py35_2          10 KB  free
mpmath-0.19                |           py35_1         897 KB  free
multipledispatch-0.4.8     |           py35_0          12 KB  free
nb_anacondacloud-1.2.0     |           py35_0          23 KB  free
nb_conda-2.0.0             |           py35_0          28 KB  free
nb_conda_kernels-2.0.0     |           py35_0          30 KB  free
nbconvert-4.2.0            |           py35_0         358 KB  free
nbformat-4.1.0             |           py35_0         159 KB  free
nbpresent-3.0.2            |           py35_0         502 KB  free
networkx-1.11              |           py35_0         1.1 MB  free
nltk-3.2.1                 |           py35_0         1.8 MB  free
notebook-4.2.3             |           py35_0         5.2 MB  free
numba-0.28.1               |      np111py35_0         1.9 MB  free
numexpr-2.6.1              |      np111py35_0         142 KB  free
numpy-1.11.1               |           py35_1         2.8 MB  free
odo-0.5.0                  |           py35_1         219 KB  free
openpyxl-2.3.2             |           py35_0         253 KB  free
openssl-1.0.2j             |           vc14_0         5.1 MB  free
pandas-0.18.1              |      np111py35_0         6.9 MB  free
partd-0.3.6                |           py35_0          25 KB  free
path.py-8.2.1              |           py35_0          47 KB  free
pathlib2-2.1.0             |           py35_0          28 KB  free
patsy-0.4.1                |           py35_0         370 KB  free
pep8-1.7.0                 |           py35_0          67 KB  free
pickleshare-0.7.4          |           py35_0           9 KB  free
pillow-3.3.1               |           py35_0         983 KB  free
pip-8.1.2                  |           py35_0         1.6 MB  free
pkginfo-1.3.2              |           py35_0          73 KB  free
ply-3.9                    |           py35_0          72 KB  free
prompt_toolkit-1.0.3       |           py35_0         308 KB  free
psutil-4.3.1               |           py35_0         228 KB  free
py-1.4.31                  |           py35_0         127 KB  free
pyasn1-0.1.9               |           py35_0          57 KB  free
pycosat-0.6.1              |           py35_1          80 KB  free
pycparser-2.14             |           py35_1         152 KB  free
pycrypto-2.6.1             |           py35_4         481 KB  free
pycurl-7.43.0              |           py35_0          89 KB  free
pyflakes-1.3.0             |           py35_0         119 KB  free
pygments-2.1.3             |           py35_0         1.3 MB  free
pylint-1.5.4               |           py35_1         347 KB  free
pyopenssl-16.0.0           |           py35_0          68 KB  free
pyparsing-2.1.4            |           py35_0          72 KB  free
pyqt-5.6.0                 |           py35_0         4.4 MB  free
pytables-3.2.2             |      np111py35_4         1.5 MB  free
pytest-2.9.2               |           py35_0         282 KB  free
python-3.5.2               |                0        30.3 MB  free
python-dateutil-2.5.3      |           py35_0         237 KB  free
pytz-2016.6.1              |           py35_0         171 KB  free
pywin32-220                |           py35_1        10.4 MB  free
pyyaml-3.12                |           py35_0         118 KB  free
pyzmq-15.4.0               |           py35_0         498 KB  free
qt-5.6.0                   |           vc14_0        51.2 MB  free
qtawesome-0.3.3            |           py35_0         153 KB  free
qtconsole-4.2.1            |           py35_2         201 KB  free
qtpy-1.1.2                 |           py35_0          22 KB  free
requests-2.11.1            |           py35_0         665 KB  free
rope-0.9.4                 |           py35_1         237 KB  free
scikit-image-0.12.3        |      np111py35_1        17.6 MB  free
scikit-learn-0.17.1        |      np111py35_1         3.5 MB  free
scipy-0.18.1               |      np111py35_0        11.7 MB  free
setuptools-27.2.0          |           py35_1         761 KB  free
simplegeneric-0.8.1        |           py35_1           7 KB  free
singledispatch-3.4.0.3     |           py35_0          13 KB  free
six-1.10.0                 |           py35_0           8 KB  free
snowballstemmer-1.2.1      |           py35_0          79 KB  free
sockjs-tornado-1.0.3       |           py35_0          33 KB  free
sphinx-1.4.6               |           py35_0         1.3 MB  free
spyder-3.0.0               |           py35_0         2.9 MB  free
sqlalchemy-1.0.13          |           py35_0         1.4 MB  free
statsmodels-0.6.1          |      np111py35_1         4.7 MB  free
sympy-1.0                  |           py35_0         6.4 MB  free
toolz-0.8.0                |           py35_0          80 KB  free
tornado-4.4.1              |           py35_0         595 KB  free
traitlets-4.3.0            |           py35_0         124 KB  free
unicodecsv-0.14.1          |           py35_0          20 KB  free
vs2015_runtime-14.0.25123  |                0         1.9 MB  free
wcwidth-0.1.7              |           py35_0          21 KB  free
werkzeug-0.11.11           |           py35_0         335 KB  free
widgetsnbextension-1.2.6   |           py35_0         1.1 MB  free
win_unicode_console-0.5    |           py35_0          27 KB  free
wrapt-1.10.6               |           py35_0          38 KB  free
xlrd-1.0.0                 |           py35_0         182 KB  free
xlsxwriter-0.9.3           |           py35_0         192 KB  free
xlwings-0.10.0             |           py35_0         741 KB  free
xlwt-1.1.2                 |           py35_0         157 KB  free
zlib-1.2.8                 |           vc14_3         111 KB  free
------------------------------------------------------------
Total:       385.1 MB