Skip to content

Instantly share code, notes, and snippets.

@ijstokes
Last active April 11, 2023 16:32
Show Gist options
  • Save ijstokes/45605149213e1630e928d8ff4cbdbe5f to your computer and use it in GitHub Desktop.
Save ijstokes/45605149213e1630e928d8ff4cbdbe5f to your computer and use it in GitHub Desktop.
Anaconda Latest: packages in the latest release of Anaconda (currently 4.4), without versions. This can be used to update all (and only) the packages that are found in Anaconda to the latest available version, since (you may be surprised to learn) the command `conda update anaconda` will not do this for you (see explanation below).
alabaster
anaconda-client
anaconda-navigator
anaconda-project
appnope
appscript
asn1crypto
astroid
astropy
babel
backports
beautifulsoup4
bitarray
blaze
bleach
bokeh
boto
boto3
botocore
bottleneck
ca-certificates
cffi
chardet
click
cloudpickle
clyent
colorama
contextlib2
cryptography
curl
cycler
cython
cytoolz
dask
datashape
decorator
distributed
docutils
entrypoints
et_xmlfile
fastcache
flask
flask-cors
freetype
get_terminal_size
gevent
gmp
gmpy2
greenlet
h5py
hdf5
heapdict
html5lib
icu
idna
imageio
imagesize
ipykernel
ipython
ipython_genutils
ipywidgets
isort
itsdangerous
jbig
jdcal
jedi
jinja2
jmespath
jpeg
jsonschema
jupyter
jupyter_client
jupyter_console
jupyter_core
lazy-object-proxy
libffi
libiconv
libpng
libsodium
libtiff
libxml2
libxslt
llvmlite
locket
lxml
markupsafe
matplotlib
mccabe
mistune
mkl
mkl-service
mpc
mpfr
mpmath
msgpack-python
multipledispatch
navigator-updater
nbconvert
nbformat
networkx
nltk
nose
notebook
numba
numexpr
numpy
numpydoc
odo
olefile
openpyxl
openssl
packaging
pandas
pandoc
pandocfilters
partd
path.py
pathlib2
patsy
pep8
pexpect
pickleshare
pillow
pip
ply
prompt_toolkit
psutil
ptyprocess
py
pycosat
pycparser
pycrypto
pycurl
pyflakes
pygments
pylint
pyodbc
pyopenssl
pyparsing
pyqt
pytables
pytest
python
python-dateutil
python.app
pytz
pywavelets
pyyaml
pyzmq
qt
qtawesome
qtconsole
qtpy
readline
requests
rope
ruamel_yaml
s3fs
s3transfer
scikit-image
scikit-learn
scipy
seaborn
setuptools
simplegeneric
singledispatch
sip
six
snowballstemmer
sortedcollections
sortedcontainers
sphinx
spyder
sqlalchemy
sqlite
statsmodels
sympy
tblib
terminado
testpath
tk
toolz
tornado
traitlets
unicodecsv
unixodbc
wcwidth
webencodings
werkzeug
wheel
widgetsnbextension
wrapt
xlrd
xlsxwriter
xlwings
xlwt
xz
yaml
zeromq
zict
zlib
@ijstokes
Copy link
Author

The way to use this file is to download the raw version of the file and then execute:

conda install --file anaconda_latest_pkgs_no_versions.txt

(add in your favorite channels if you want to pull packages from there instead).

This will give you the latest versions of all the packages that are found in Anaconda. Note that this is different from executing the command:

conda update anaconda

since that command will install the latest version of the anaconda meta-package, and that meta-package has a set of pinned package versions. This means there are three possible scenarios:

  1. The user had installed a virgin (un-modified) instance of Anaconda and they want to now have it updated to exactly the latest release of Anaconda. The command conda update anaconda will do exactly this. The user will be happy.

  2. The user wants the latest version of each package inside Anaconda. Since a particular (e.g. "the latest") Anaconda release pins the versions of all the packages associated with it they are unlikely to get the latest version of each individual package: individual packages may have been updated and new conda packages released since the latest Anaconda version, and these new releases will not be picked up. The user will not be happy (or will not know this has happened, and unknowingly not have the latest version, even though it is their expectation to get the latest version when they execute this command).

  3. The user wants the latest version of each package inside Anaconda. Four months ago they updated to the latest version of Anaconda available at that time (say, 4.1), then 2 months ago a new version came out (4.2) but they didn't update to it. Then 1 month ago they updated several key packages that just had major updates (say pandas, numpy, jupyter). Then today the user decides they should "update" everything else in anaconda and invokes the above update command (conda update anaconda). What this will do is discover (effectively) that Anaconda 4.1 was the last version installed, and that Anaconda 4.2 is the latest version available, so it will then go and "update" all packages (and dependencies) to the EXACT versions specified in Anaconda 4.2. From two months ago. Before those new packages for pandas, numpy, and jupyter were released and installed into the local environment. Meaning those specific packages (pandas, numpy, and jupyter) will actually be DOWNGRADED as part of Anaconda being UPGRADED from 4.1 to 4.2. If they are paying attention to the output of the conda command at least they will be told that some packages are going to be DOWNGRADED. But it will probably be confusing for them and in this scenario they will be unhappy.

For users in Scenario 2 or Scenario 3 they should use the file attached to this gist and the command referenced above to update their system.

As a final note: because of the way dependency resolution is done it may be the case that even when using the technique described here one would not end up with the latest version available for all 200 packages inside Anaconda, simply because the "latest" version is not supported based on some dependency of one of the other packages. The conda dependency solver does its best to find the latest version of all packages, and minimizes the number of times it uses an older version of a package to satisfy dependency constraints.

@neilser
Copy link

neilser commented Feb 4, 2018

This seems like a great idea - thanks!
I just tried it though, and seems like it's sufficiently old that it no longer works. Or, my initial attempts to persuade Anaconda 5.0.1 to update properly have ended up breaking it :-/
The error:

Solving environment: failed

PackagesNotFoundError: The following packages are not available from current channels:

  - libffi
  - appscript
  - unixodbc
  - gmp
  - appnope
  - readline
  - ptyprocess
  - python.app
  - jbig

Current channels:

  - https://repo.continuum.io/pkgs/main/win-64
  - https://repo.continuum.io/pkgs/main/noarch
  - https://repo.continuum.io/pkgs/free/win-64
  - https://repo.continuum.io/pkgs/free/noarch
  - https://repo.continuum.io/pkgs/r/win-64
  - https://repo.continuum.io/pkgs/r/noarch
  - https://repo.continuum.io/pkgs/pro/win-64
  - https://repo.continuum.io/pkgs/pro/noarch
  - https://repo.continuum.io/pkgs/msys2/win-64
  - https://repo.continuum.io/pkgs/msys2/noarch

@franzbischoff
Copy link

franzbischoff commented Sep 13, 2018

Remove:

  • libffi
  • appscript
  • unixodbc
  • gmp
  • gmpy2
  • appnope
  • readline
  • ptyprocess
  • python.app
  • jbig

from the TXT file and try again.

@jtraylor
Copy link

Hi. Is it just a list of the current packages without version? astropy versus astropy=3.0.2

Would it more better to grab the first column of "conda list" and process that?

I compared this list with the current list and see a bunch o' packages not currently installed. I'm assuming they've dropped off. I don't want add junk. So just trying to understand the thought process here.

Thanks much!!

@jdfrost
Copy link

jdfrost commented May 21, 2019

there really ought to be a simpler way.

@dominikgehl
Copy link

How about generating that first list using conda list | awk '{print $1}' > anaconda_latest_pkgs_no_versions.txt ?

@gatotj
Copy link

gatotj commented Dec 24, 2019

When I tried to generate my own list as per this and then run the update command above, it will still produce dependency constraint meaning some packages will actually be downgraded. So, without knowing the exact reason why, I guess the above list has been generated so that downgrade of some packages won't happen, which will "hurt" the feeling of specific Anaconda user (like me) :)

Lesson learned: I need to get used to the idea that I may not use the latest/most updated tools, but rather focusing more on creating the code itself using a known set of reliable/working version (until able to understand the relationship between packages, at some point in the future).

@HLatte
Copy link

HLatte commented Sep 23, 2021

Is this list up to date?
Because I mess up with my base environment and I want to uninstall all the packages that don't belong to anaconda base.

@mullimanko
Copy link

I have the same question as HLatte.

@37310N
Copy link

37310N commented Jul 29, 2022

Thanks @dominikgehl for this solution. Almost did the job for me, but had to run sudo bash otherwise terminal prompted missing writing permissions when executing conda install --file anaconda_latest_pkgs_no_versions.txt. Also not all packages were updated, but most of them (80 out of 113).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment