conda v4.4.0 Release Notes

Release Date: 2017-12-20 // over 4 years ago
  • Recommended change to enable conda in your shell

    ๐Ÿš€ With the release of conda 4.4, we recommend a change to how the conda command is made available to your shell environment. All the old methods still work as before, but you'll need the new method to enable the new conda activate and conda deactivate commands.

    ๐Ÿ For the "Anaconda Prompt" on Windows, there is no change.

    For Bourne shell derivatives (bash, zsh, dash, etc.), you likely currently have a line similar to

    export PATH="/opt/conda/bin:$PATH"
    

    ๐ŸŽ in your ~/.bashrc file (or ~/.bash_profile file on macOS). The effect of this line is that your base environment is put on PATH, but without actually activating that environment. (In 4.4 we've renamed the 'root' environment to the 'base' environment.) With conda 4.4, we recommend removing the line where the PATH environment variable is modified, and replacing it with

    . /opt/conda/etc/profile.d/conda.sh
    conda activate base
    

    In the above, it's assumed that /opt/conda is the location where you installed miniconda or Anaconda. It may also be something like ~/Anaconda3 or ~/miniconda2.

    For system-wide conda installs, to make the conda command available to all users, rather than manipulating individual ~/.bashrc (or ~/.bash_profile) files for each user, just execute once

    $ sudo ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh
    

    This will make the conda command itself available to all users, but conda's base (root) environment will not be activated by default. Users will still need to run conda activate base to put the base environment on PATH and gain access to the executables in the base environment.

    โšก๏ธ After updating to conda 4.4, we also recommend pinning conda to a specific channel. For example, executing the command

    $ conda config --system --add pinned_packages conda-canary::conda
    

    ๐Ÿ“ฆ will make sure that whenever conda is installed or changed in an environment, the source of the package is always being pulled from the conda-canary channel. This will be useful for people who use conda-forge, to prevent conda from flipping back and forth between 4.3 and 4.4.

    ๐Ÿ†• New Feature Highlights

    • conda activate: The logic and mechanisms underlying environment activation have been reworked. With conda 4.4, conda activate and conda deactivate are now the preferred commands for activating and deactivating environments. You'll find they are much more snappy than the source activate and source deactivate commands from previous conda versions. The conda activate command also has advantages of (1) being universal across all OSes, shells, and platforms, and (2) not having path collisions with scripts from other packages like python virtualenv's activate script.

    • constrained, optional dependencies: Conda now allows a package to constrain versions of other packages installed alongside it, even if those constrained packages are not themselves hard dependencies for that package. In other words, it lets a package specify that, if another package ends up being installed into an environment, it must at least conform to a certain version specification. In effect, constrained dependencies are a type of "reverse" dependency. It gives a tool to a parent package to exclude other packages from an environment that might otherwise want to depend on it.

    Constrained optional dependencies are supported starting with conda-build 3.0 (via [conda/conda-build#2001[(https://github.com/conda/conda-build/pull/2001)). A new run_constrained keyword, which takes a list of package specs similar to the run keyword, is recognized under the requirements section of meta.yaml. For backward compatibility with versions of conda older than 4.4, a requirement may be listed in both the run and the run_constrained section. In that case older versions of conda will see the package as a hard dependency, while conda 4.4 will understand that the package is meant to be optional.

    Optional, constrained dependencies end up in repodata.json under a constrains keyword, parallel to the depends keyword for a package's hard dependencies.

    • โœจ enhanced package query language: Conda has a built-in query language for searching for and matching packages, what we often refer to as MatchSpec. The MatchSpec is what users input on the command line when they specify packages for create, install, update, and remove operations. With this release, MatchSpec (rather than a regex) becomes the default input for conda search. We have also substantially enhanced our MatchSpec query language.

    For example,

      conda install conda-forge::python
    

    is now a valid command, which specifies that regardless of the active list of channel priorities, the python package itself should come from the conda-forge channel. As before, the difference between python=3.5 and python==3.5 is that the first contains a "fuzzy" version while the second contains an exact version. The fuzzy spec will match all python packages with versions >=3.5 and <3.6. The exact spec will match only python packages with version 3.5, 3.5.0, 3.5.0.0, etc. The canonical string form for a MatchSpec is thus

      (channel::)name(version(build_string))
    

    which should feel natural to experienced conda users. Specifications however are often necessarily more complicated than this simple form can support, and for these situations we've extended the specification to include an optional square bracket [] component containing comma-separated key-value pairs to allow matching on most any field contained in a package's metadata. Take, for example,

      conda search 'conda-forge/linux-64::*[md5=e42a03f799131d5af4196ce31a1084a7]' --info
    

    which results in information for the single package

      cytoolz 0.8.2 py35_0
      --------------------
      file name   : cytoolz-0.8.2-py35_0.tar.bz2
      name        : cytoolz
      version     : 0.8.2
      build string: py35_0
      build number: 0
      size        : 1.1 MB
      arch        : x86_64
      platform    : Platform.linux
      license     : BSD 3-Clause
      subdir      : linux-64
      url         : https://conda.anaconda.org/conda-forge/linux-64/cytoolz-0.8.2-py35_0.tar.bz2
      md5         : e42a03f799131d5af4196ce31a1084a7
      dependencies:
        - python 3.5*
        - toolz >=0.8.0
    

    The square bracket notation can also be used for any field that we match on outside the package name, and will override information given in the "simple form" position. To give a contrived example, python==3.5[version='>=2.7,<2.8'] will match 2.7.* versions and not 3.5.

    • environments track user-requested state: Building on our enhanced MatchSpec query language, conda environments now also track and differentiate (a) packages added to an environment because of an explicit user request from (b) packages brought into an environment to satisfy dependencies. For example, executing

      conda install conda-forge::scikit-learn

    will confine all future changes to the scikit-learn package in the environment to the conda-forge channel, until the spec is changed again. A subsequent command conda install scikit-learn=0.18 would drop the conda-forge channel restriction from the package. And in this case, scikit-learn is the only user-defined spec, so the solver chooses dependencies from all configured channels and all available versions.

    • errors posted to core maintainers: In previous versions of conda, unexpected errors resulted in a request for users to consider posting the error as a new issue on conda's github issue tracker. In conda 4.4, we've implemented a system for users to opt-in to sending that same error report via an HTTP POST request directly to the core maintainers.

    When an unexpected error is encountered, users are prompted with the error report followed by a [y/N] input. Users can elect to send the report, with 'no' being the default response. Users can also permanently opt-in or opt-out, thereby skipping the prompt altogether, using the boolean report_errors configuration parameter.

    • ๐Ÿ’ป various UI improvements: To push through some of the big leaps with transactions in conda 4.3, we accepted some regressions on progress bars and other user interface features. All of those indicators of progress, and more, have been brought back and further improved.

    • โšก๏ธ aggressive updates: Conda now supports an aggressive_update_packages configuration parameter that holds a sequence of MatchSpec strings, in addition to the pinned_packages configuration parameter. Currently, the default value contains the packages ca-certificates, certifi, and openssl. When manipulating configuration with the conda config command, use of the --system and --env flags will be especially helpful here. For example,

      conda config --add aggressive_update_packages defaults::pyopenssl --system

    would ensure that, system-wide, solves on all environments enforce using the latest version of pyopenssl from the defaults channel.

      conda config --add pinned_packages python=2.7 --env
    

    would lock all solves for the current active environment to python versions matching 2.7.*.

    • ๐Ÿ”ง other configuration improvements: In addition to conda config --describe, which shows detailed descriptions and default values for all available configuration parameters, we have a new conda config --write-default command. This new command simply writes the contents of conda config --describe to a condarc file, which is a great starter template. Without additional arguments, the command will write to the .condarc file in the user's home directory. The command also works with the --system, --env, and --file flags to write the contents to alternate locations.

    Conda exposes a tremendous amount of flexibility via configuration. For more information, The Conda Configuration Engine for Power Users blog post is a good resource.

    ๐Ÿ—„ Deprecations/Breaking Changes

    • the conda 'root' environment is now generally referred to as the 'base' environment
    • Conda 4.4 now warns when available information about per-path sha256 sums and file sizes do not match the recorded information. The warning is scheduled to be an error in conda 4.5. Behavior is configurable via the safety_checks configuration parameter.
    • ๐Ÿ”‹ remove support for with_features_depends (#5191)
    • ๐Ÿšš resolve #5468 remove --alt-hint from CLI API (#5469)
    • 0๏ธโƒฃ resolve #5834 change default value of 'allow_softlinks' from True to False (#5835)
    • ๐Ÿ—„ resolve #5842 add deprecation warnings for 'conda env upload' and 'conda env attach' (#5843)

    API

    • โž• Add Solver from conda.core.solver with three methods to conda.api (4.4.0rc1) (#5838)

    ๐Ÿ‘Œ Improvements

    • constrained, optional dependencies (#4982)
    • conda shell function (#5044, #5141, #5162, #5169, #5182, #5210, #5482)
    • ๐Ÿ”Œ resolve #5160 conda xontrib plugin (#5157)
    • โœ… resolve #1543 add support and tests for --no-deps and --only-deps (#5265)
    • ๐Ÿ“ฆ resolve #988 allow channel name to be part of the package name spec (#5365, #5791)
    • resolve #5530 add ability for users to choose to post unexpected errors to core maintainers (#5531, #5571, #5585)
    • ๐Ÿ’ป Solver, UI, History, and Other (#5546, #5583, #5740)
    • ๐Ÿ‘Œ improve 'conda search' to leverage new MatchSpec query language (#5597)
    • ๐Ÿ“ฆ filter out unwritable package caches from conda clean command (#4620)
    • โœ… envs_manager, requested spec history, declarative solve, and private env tests (#4676, #5114, #5094, #5145, #5492)
    • ๐Ÿ‘‰ make python entry point format match pip entry points (#5010)
    • resolve #5113 clean up CLI imports to improve process startup time (#4799)
    • ๐Ÿ‘ resolve #5121 add features/track_features support for MatchSpec (#5054)
    • resolve #4671 hold verify backoff count in transaction context (#5122)
    • ๐Ÿ“‡ resolve #5078 record package metadata after tarball extraction (#5148)
    • ๐Ÿ‘ resolve #3580 support stacking environments (#5159)
    • resolve #3763, #4378 allow pip requirements.txt syntax in environment files (#3969)
    • resolve #5147 add 'config files' to conda info (#5269)
    • ๐Ÿ“ฆ use --format=json to parse list of pip packages (#5205)
    • ๐Ÿšš resolve #1427 remove startswith '.' environment name constraint (#5284)
    • ๐Ÿ”— link packages from extracted tarballs when tarball is gone (#5289)
    • resolve #2511 accept config information from stdin (#5309)
    • resolve #4302 add ability to set map parameters with conda config (#5310)
    • resolve #5256 enable conda config --get for all primitive parameters (#5312)
    • resolve #1992 add short flag -C for --use-index-cache (#5314)
    • resolve #2173 add --quiet option to conda clean (#5313)
    • resolve #5358 conda should exec to subcommands, not subprocess (#5359)
    • 0๏ธโƒฃ resolve #5411 add 'conda config --write-default' (#5412)
    • ๐Ÿ“ฆ resolve #5081 make pinned packages optional dependencies (#5414)
    • ๐Ÿ—„ resolve #5430 eliminate current deprecation warnings (#5422)
    • resolve #5470 make stdout/stderr capture in python_api customizable (#5471)
    • ๐ŸŒฒ logging simplifications/improvements (#5547, #5578)
    • โšก๏ธ update license information (#5568)
    • 0๏ธโƒฃ enable threadpool use for repodata collection by default (#5546, #5587)
    • ๐Ÿ“ฆ conda info now raises PackagesNotFoundError (#5655)
    • ๐Ÿ— index building optimizations (#5776)
    • ๐Ÿ›  fix #5811 change safety_checks default to 'warn' for conda 4.4 (4.4.0rc1) (#5824)
    • โž• add constrained dependencies to conda's own recipe (4.4.0rc1) (#5823)
    • ๐Ÿ“œ clean up parser imports (4.4.0rc2) (#5844)
    • โšก๏ธ resolve #5983 add --download-only flag to create, install, and update (4.4.0rc2) (#5988)
    • โšก๏ธ add ca-certificates and certifi to aggressive_update_packages default (4.4.0rc2) (#5994)
    • ๐Ÿ‘‰ use environments.txt to list all known environments (4.4.0rc2) (#6313)
    • resolve #5417 ensure unlink order is correctly sorted (4.4.0) (#6364)
    • resolve #5370 index is only prefix and cache in --offline mode (4.4.0) (#6371)
    • โฌ‡๏ธ reduce redundant sys call during file copying (4.4.0rc3) (#6421)
    • โšก๏ธ enable aggressive_update_packages (4.4.0rc3) (#6392)
    • 0๏ธโƒฃ default conda.sh to dash if otherwise can't detect (4.4.0rc3) (#6414)
    • ๐Ÿ“ฆ canonicalize package names when comparing with pip (4.4.0rc3) (#6438)
    • โž• add target prefix override configuration parameter (4.4.0rc3) (#6413)
    • resolve #6194 warn when conda is outdated (4.4.0rc3) (#6370)
    • โž• add information to displayed error report (4.4.0rc3) (#6437)
    • csh wrapper (4.4.0) (#6463)
    • resolve #5158 --override-channels (4.4.0) (#6467)
    • โšก๏ธ fish update for conda 4.4 (4.4.0) (#6475, #6502)
    • skip an unnecessary environments.txt rewrite (4.4.0) (#6495)

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  fix some conda-build compatibility issues (#5089)
    • resolve #5123 export toposort (#5124)
    • ๐Ÿ›  fix #5132 signal handler can only be used in main thread (#5133)
    • ๐Ÿ›  fix orphaned --clobber parser arg (#5188)
    • ๐Ÿ›  fix #3814 don't remove directory that's not a conda environment (#5204)
    • ๐Ÿ›  fix #4468 _license stack trace (#5206)
    • ๐Ÿ›  fix #4987 conda update --all no longer displays full list of packages (#5228)
    • ๐Ÿ›  fix #3489 don't error on remove --all if environment doesn't exist (#5231)
    • ๐Ÿ›  fix #1509 bash doesn't need full path for pre/post link/unlink scripts on unix (#5252)
    • ๐Ÿ›  fix #462 add regression test (#5286)
    • ๐Ÿ›  fix #5288 confirmation prompt doesn't accept no (#5291)
    • ๐Ÿ›  fix #1713 'conda package -w' is case dependent on Windows (#5308)
    • ๐Ÿ›  fix #5371 try falling back to pip's vendored requests if no requests available (#5372)
    • ๐Ÿ›  fix #5356 skip root logger configuration (#5380)
    • ๐Ÿ›  fix #5466 scrambled URL of non-alias channel with token (#5467)
    • ๐Ÿ›  fix #5444 environment.yml file not found (#5475)
    • ๐Ÿ›  fix #3200 use proper unbound checks in bash code and test (#5476)
    • ๐Ÿ— invalidate PrefixData cache on rm_rf for conda-build (#5491, #5499)
    • ๐Ÿ›  fix exception when generating JSON output (#5628)
    • ๐Ÿ›  fix target prefix determination (#5642)
    • ๐Ÿ‘‰ use proxy to avoid segfaults (#5716)
    • ๐Ÿ›  fix #5790 incorrect activation message (4.4.0rc1) (#5820)
    • ๐Ÿ›  fix #5808 assertion error when loading package cache (4.4.0rc1) (#5815)
    • fix #5809 _pip_install_via_requirements got an unexpected keyword argument 'prune' (4.4.0rc1) (#5814)
    • ๐Ÿ›  fix #5811 change safety_checks default to 'warn' for conda 4.4 (4.4.0rc1) (#5824)
    • ๐Ÿ›  fix #5825 --json output format (4.4.0rc1) (#5831)
    • ๐Ÿ›  fix force_reinstall for case when packages aren't actually installed (4.4.0rc1) (#5836)
    • ๐Ÿ›  fix #5680 empty pip subsection error in environment.yml (4.4.0rc2) (#6275)
    • ๐Ÿ›  fix #5852 bad tokens from history crash conda installs (4.4.0rc2) (#6076)
    • ๐Ÿ›  fix #5827 no error message on invalid command (4.4.0rc2) (#6352)
    • ๐Ÿ›  fix exception handler for 'conda activate' (4.4.0rc2) (#6365)
    • ๐Ÿ›  fix #6173 double prompt immediately after conda 4.4 upgrade (4.4.0rc2) (#6351)
    • ๐Ÿ›  fix #6181 keep existing pythons pinned to minor version (4.4.0rc2) (#6363)
    • ๐Ÿ›  fix #6201 incorrect subdir shown for conda search when package not found (4.4.0rc2) (#6367)
    • ๐Ÿ›  fix #6045 help message and zsh shift (4.4.0rc3) (#6368)
    • ๐Ÿ›  fix noarch python package resintall (4.4.0rc3) (#6394)
    • ๐Ÿ›  fix #6366 shell activation message (4.4.0rc3) (#6369)
    • ๐Ÿ›  fix #6429 AttributeError on 'conda remove' (4.4.0rc3) (#6434)
    • ๐Ÿ›  fix #6449 problems with 'conda info --envs' (#6451)
    • โž• add debug exception for #6430 (4.4.0rc3) (#6435)
    • ๐Ÿ›  fix #6441 NotImplementedError on 'conda list' (4.4.0rc3) (#6442)
    • ๐Ÿ›  fix #6445 scale back directory activation in PWD (4.4.0rc3) (#6447)
    • ๐Ÿ›  fix #6283 no-deps for conda update case (4.4.0rc3) (#6448)
    • ๐Ÿ›  fix #6419 set PS1 in python code (4.4.0rc3) (#6446)
    • ๐Ÿ›  fix #6466 sp_dir doesn't exist (#6470)
    • ๐Ÿ›  fix #6350 --update-all removes too many packages (4.4.0) (#6491)
    • ๐Ÿ›  fix #6057 unlink-link order for python noarch packages on windows 4.4.x (4.4.0) (#6494)

    Non-User-Facing Changes

    • eliminate index modification in Resolve init (#4333)
    • ๐Ÿ†• new MatchSpec implementation (#4158, #5517)
    • โšก๏ธ update conda.recipe for 4.4 (#5086)
    • ๐Ÿš€ resolve #5118 organization and cleanup for 4.4 release (#5115)
    • โœ‚ remove unused disk space check instructions (#5167)
    • โœ… localfs adapter tests (#5181)
    • โœ… extra config command tests (#5185)
    • โž• add coverage for confirm (#5203)
    • clean up FileNotFoundError and DirectoryNotFoundError (#5237)
    • โž• add assertion that a path only has a single hard link before rewriting prefixes (#5305)
    • โœ‚ remove pycrypto as requirement on windows (#5326)
    • import cleanup, dead code removal, coverage improvements, and other housekeeping (#5472, #5474, #5480)
    • ๐Ÿ“‡ rename CondaFileNotFoundError to PathNotFoundError (#5521)
    • work toward repodata API (#5267)
    • ๐Ÿ“ฆ rename PackageNotFoundError to PackagesNotFoundError and fix message formatting (#5602)
    • โšก๏ธ update conda 4.4 bld.bat windows recipe (#5573)
    • โœ‚ remove last remnant of CondaEnvRuntimeError (#5643)
    • ๐Ÿ›  fix typo (4.4.0rc2) (#6043)
    • replace Travis-CI with CircleCI (4.4.0rc2) (#6345)
    • โช key-value features (#5645); reverted in 4.4.0rc2 (#6347, #6492)
    • resolve #6431 always add env_vars to info_dict (4.4.0rc3) (#6436)
    • ๐Ÿšš move shell inside conda directory (4.4.0) (#6479)
    • โœ‚ remove dead code (4.4.0) (#6489)