I am trying to install a Python 2.7 environment with some old packages from around 2014-2015. I have record of the working conda environments from back then which pulled from the default channels of anaconda but when I try something as simple as:
$ conda create -n test -c defaults python=2.7 matplotlib=1.4.2
Channels:
- defaults
- conda-forge
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: failed
PackagesNotFoundError: The following packages are not available from current channels:
- matplotlib=1.4.2
Current channels:
- defaults
- https://conda.anaconda.org/conda-forge
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
The old packages are not found. When I manually search anaconda.org, the packages do not not seem to be present. For example, matplotlib only goes back to 2.0.2 or so. Did these older packages get moved somewhere else? Or do they no longer exist?
Thanks,
Jason
I made some progress. I found the “free” channel on anaconda.org and this channel seems to have older packages. The env file I trying to get running is:
# CONDA_CHANNEL_PRIORITY=false conda env create -f perturbed-data-paper-env.yml
name: perturbed-data-paper
channels:
- defaults
- free # old packages may be here
dependencies:
- ipython==3.0.0 # for Python 2
- matplotlib=1.4.2
- numpy==1.9.2
- pandas==0.16.0
- pip <21 # for Python 2
- pygments==2.0.2
- pytables==3.1.1
- python=2.7.9
- pyyaml==3.11
- scipy==0.15.1
- seaborn==0.5.1
- decorator <4 # trailets
- pyqt==4.10.4
- pyside==1.2.1
- pip:
- DynamicistToolKit==0.3.5
- GaitAnalysisToolKit==0.1.2
- oct2py==3.1.1
This now installs and is close to running the 10+ year old scripts I have. I had to set the matplotlib backend to agg because the old packages link to system libs that are too new for qt to work. Also I had NumPy 1.9.1 and that had missing symbols or something. I’m now hung on oct2py needing an old octave to run, which isn’t installed by conda or pip.
The issue occurs because older package versions, like matplotlib 1.4.2
, have been removed from the default conda
channels. You can try using the conda-forge
or anaconda
archive channels, or manually install from a cached package repository like https://anaconda.org/anaconda/matplotlib/files
. Alternatively, consider using conda constructor
to rebuild the environment from a previously exported YAML file or install missing packages via pip
if available. Another option is to use conda mirror
to access old package archives or check for historical versions in https://repo.anaconda.com/pkgs/free/
.
Ok, so these packages are moved somewhere, I now see that the ‘anaconda’ and 'free" channels may have some older packages. I will also try the ‘anaconda’ channel, which I did not know about. I just checked and the ‘anaconda’ channel matplotlib only goes back to 2.0.2.
I have a secondary question: why would old packages be moved or made inaccessible? This makes reproducing environments impossible.
The packages were not actually moved anywhere - they are still in the channel they were originally. Very few packages are removed - and usually only for a critical issue. How “defaults” is defined has changed however. You can set your channels to be how defaults was defined in the past in your .condarc file. (with the free channel on repo.anaconda.com). This is a better choice than using the channels on anaconda.org, as there are sometimes repodata patches that were applied that are not available for the free channel on anaconda.org. There are many reasons not to keep all the packages ever built in one channel.
Anaconda Packages defines the various channels available.
Using the free channel — conda 25.3.0 documentation
Unfortunately, right now Anaconda only builds and distributes conda packages - so the packages you installed with pip would not be in any Anaconda channels. You might have to build those yourself from source if you cannot find it elsewhere.
Thanks for the tip. Is setting the env.yml file like:
name: perturbed-data-paper
channels:
- free
dependencies:
The correct way to set how defaults was defined in the past?
I see from the documentation you shared that this may not be possible strictly from an environment file and only possible from modifying the condarc. I may need to install a new miniconda to test that so I don’t chance corrupt my current miniconda install with such a change.