conda v4.4.0 Release Notes
Release Date: 2017-12-20 // over 6 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 newconda activate
andconda 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 thePATH
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 runconda 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 useconda-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
andconda deactivate
are now the preferred commands for activating and deactivating environments. You'll find they are much more snappy than thesource activate
andsource deactivate
commands from previous conda versions. Theconda 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 therun
keyword, is recognized under therequirements
section ofmeta.yaml
. For backward compatibility with versions of conda older than 4.4, a requirement may be listed in both therun
and therun_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 aconstrains
keyword, parallel to thedepends
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 forcreate
,install
,update
, andremove
operations. With this release, MatchSpec (rather than a regex) becomes the default input forconda 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 betweenpython=3.5
andpython==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 version3.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 match2.7.*
versions and not3.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 theconda-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 booleanreport_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 thepinned_packages
configuration parameter. Currently, the default value contains the packagesca-certificates
,certifi
, andopenssl
. When manipulating configuration with theconda 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 thedefaults
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 newconda config --write-default
command. This new command simply writes the contents ofconda 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)