Conda Cheat Sheet 4.8



Conda is a powerful package manager and environment manager thatyou use with command line commands at the Anaconda Prompt for Windows,or in a terminal window for macOS or Linux.

This 20-minute guide to getting started with conda lets you try outthe major features of conda. You should understand how conda workswhen you finish this guide.

NOTE: These Diagramming Sheets are featured in the Ultimate Language Arts Cheat Sheets. This is a digital download. No physical copy will be shipped. Learn how to diagram sentences with this easy breakdown! Diagramming sentences was one of my biggest struggles in elementary school. It was complex, and I never fully understood the different parts of speech until later. However, knowing how to. Conda activate the-name-of-environment. 3.- To get a list of your environment: conda env list. 4.- In order to use our envelopes in Jupyter we must install ipykernel: conda install -c anaconda. 4.8.7; Label: All All; Files with no label broken cf201901 cf202003 gcc7 main test Type Size Name Uploaded Uploader Downloads Labels; conda: 23.4 MB. Conda-forge 7483: main cf202003 conda.

SEE ALSO: Getting started with Anaconda Navigator, agraphical user interface that lets you use conda in a web-like interfacewithout having to enter manual commands. Compare the Getting startedguides for each to see which program you prefer.

Before you start¶

You should have already installedAnaconda.

Contents¶

  • Starting conda on Windows, macOS, or Linux. 2 MINUTES

  • Managing conda. Verify that Anaconda is installed and check that conda is updated to the current version. 3 MINUTES

  • Managing environments. Create environments and move easily between them. 5 MINUTES

  • Managing Python. Create an environment that has a different version of Python. 5 MINUTES

  • Managing packages. Find packages available for you to install. Install packages. 5 MINUTES

TOTAL TIME: 20 MINUTES

Starting conda¶

Conda env export cut -f 1 -d '=' environment.yml Creating a new environment from a YAML file conda env create -f environment.yml Updating a conda env using a YAML file conda env update -file environment.yml Conclusion. And there you have it, most of the everyday conda env commands you will ever need. If you have any additional ones, feel. Conda Enjoy this cheat sheet at its fullest within Dash, the macOS documentation browser. Managing Conda and Anaconda conda info. Verify conda is installed, check version # conda update conda. Update conda package and environment manager. Conda update anaconda. Update the anaconda meta package.

Windows

  • From the Start menu, search for and open 'Anaconda Prompt.'

On Windows, all commands below are typed into the Anaconda Prompt window.

MacOS

  • Open Launchpad, then click the terminal icon.

On macOS, all commands below are typed into the terminal window.

Linux

  • Open a terminal window.

4.8

On Linux, all commands below are typed into the terminal window.

Managing conda¶

Verify that conda is installed and running on your system by typing:

Conda displays the number of the version that you have installed. You do notneed to navigate to the Anaconda directory.

EXAMPLE: conda4.7.12

Note

If you get an error message, make sure you closed and re-opened theterminal window after installing, or do it now. Then verify that you are loggedinto the same user account that you used to install Anaconda or Miniconda.

Update conda to the current version. Type the following:

Conda compares versions and then displays what is available to install.

If a newer version of conda is available, type y to update:

Tip

We recommend that you always keep conda updated to the latest version.

Managing environments¶

Conda allows you to create separate environments containing files, packages,and their dependencies that will not interact with other environments.

When you begin using conda, you already have a default environment namedbase. You don't want to put programs into your base environment, though.Create separate environments to keep your programs isolated from each other.

  1. Create a new environment and install a package in it.

    We will name the environment snowflakes and install the packageBioPython. At the Anaconda Prompt or in your terminal window, typethe following:

    Conda checks to see what additional packages ('dependencies')BioPython will need, and asks if you want to proceed:

    Type 'y' and press Enter to proceed.

  2. To use, or 'activate' the new environment, type the following:

    • Windows: condaactivatesnowflakes

    • macOS and Linux: condaactivatesnowflakes

    Note

    condaactivate only works on conda 4.6 and later versions.

    For conda versions prior to 4.6, type:

    • Windows: activatesnowflakes

    • macOS and Linux: sourceactivatesnowflakes

    Now that you are in your snowflakes environment, any condacommands you type will go to that environment untilyou deactivate it.

  3. To see a list of all your environments, type:

    A list of environments appears, similar to the following:

    Tip

    The active environment is the one with an asterisk (*).

  4. Change your current environment back to the default (base):condaactivate

    Note

    For versions prior to conda 4.6, use:

    Tip

    When the environment is deactivated, its name is nolonger shown in your prompt, and the asterisk (*) returns to base.To verify, you can repeat the condainfo--envs command.

Managing Python¶

When you create a new environment, conda installs the same Python version youused when you downloaded and installed Anaconda. If you want to use a differentversion of Python, for example Python 3.5, simply create a new environment andspecify the version of Python that you want.

  1. Create a new environment named 'snakes' that contains Python 3.5:

    When conda asks if you want to proceed, type 'y' and press Enter.

  2. Activate the new environment:

    • Windows: condaactivatesnakes

    • macOS and Linux: condaactivatesnakes

    Note

    condaactivate only works on conda 4.6 and later versions.

    For conda versions prior to 4.6, type:

    • Windows: activatesnakes

    • macOS and Linux: sourceactivatesnakes

  3. Verify that the snakes environment has been added and is active:

    Conda displays the list of all environments with an asterisk (*)after the name of the active environment:

    The active environment is also displayed in front of your prompt in(parentheses) or [brackets] like this:

  4. Verify which version of Python is in your currentenvironment:

  5. Deactivate the snakes environment and return to base environment:condaactivate

    Note

    For versions prior to conda 4.6, use:

Managing packages¶

In this section, you check which packages you have installed,check which are available and look for a specific package andinstall it.

  1. To find a package you have already installed, first activate the environmentyou want to search. Look above for the commands toactivate your snakes environment.

  2. Check to see if a package you have not installed named'beautifulsoup4' is available from the Anaconda repository(must be connected to the Internet):

    Conda displays a list of all packages with that name on the Anacondarepository, so we know it is available.

  3. Install this package into the current environment:

  4. Check to see if the newly installed program is in this environment:

More information¶

  • Full documentation--- https://conda.io/docs/

  • Free community support--- https://groups.google.com/a/anaconda.com/forum/#!forum/anaconda

  • Paid support options--- https://www.anaconda.com/support/

In conda 4.6+, the way that you interact with conda goes through a batch script (%PREFIX%condabinconda.bat).Unfortunately, this means it's a little complicated to use conda from other batch scripts. When using batchscripts from within batch scripts, you must prefix your command with CALL. If you do not do this, your batchscript that calls conda will exit immediately after the conda usage. In other words, if you write this in a .bat file:

Neither the activation, nor the echo will happen. You must write this in your batch script:

This is known behavior with cmd.exe, and we have not found any way to change it.https://stackoverflow.com/questions/4798879/how-do-i-run-a-batch-script-from-within-a-batch-script/4798965

Error messages like

or

Cause¶

NumPy is unable to load the correct MKL or Intel OpenMP runtime libraries. Thisis almost always caused by one of two things:

  1. The environment with NumPy has not been activated.

  2. Another software vendor has installed MKL or Intel OpenMP (libiomp5md.dll)files into the C:WindowsSystem32 folder. These files are being loadedbefore Anaconda's and they're not compatible.

Solution¶

If you are not activating your environments, start with doing that. There's moreinfo at Activating environments. If you are still stuck, you may need to considermore drastic measures.

  1. Remove any MKL-related files from C:WindowsSystem32. We recommendrenaming them to add .bak to the filename to effectively hide them. Observeif any other software breaks. Try moving the DLL files alongside the .exe ofthe software that broke. If it works again, you can keep things in themoved state - Anaconda doesn't need MKL in System32, and no other software should need it either. Ifyou identify software that is installing software here, please contact thecreators of that software. Inform them that their practice of installingMKL to a global location is fragile and is breaking other people's softwareand wasting a lot of time. See the list of guilty parties below.

  2. You may try a special DLL loading mode that Anaconda builds into Python.This changes the DLL search path from System32 first to System32 as anotherentry on PATH, allowing libraries in your conda environment to be foundbefore the libraries in System32. Control of this feature is done withenvironment variables. Only Python builds beyond these builds will react tothese environment variables:

    • Python 2.7.15 build 14

    • Python 3.6.8 build 7

    • Python 3.7.2 build 8

    To update Python from the defaults channel:

    Note

    Anaconda has built special patches into its builds of Python to enablethis functionality. If you get your Python package from somewhere else(e.g. conda-forge), these flags may not do anything.

    Control environment variables:

    • CONDA_DLL_SEARCH_MODIFICATION_ENABLE

    • CONDA_DLL_SEARCH_MODIFICATION_DEBUG

    • CONDA_DLL_SEARCH_MODIFICATION_NEVER_ADD_WINDOWS_DIRECTORY

    • CONDA_DLL_SEARCH_MODIFICATION_NEVER_ADD_CWD

    To set variables on Windows, you may use either the CLI (Anaconda Prompt, for example) or a Windows GUI.

    • CLI: https://superuser.com/questions/79612/setting-and-getting-windows-environment-variables-from-the-command-prompt/79614

    • GUI: http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-windows-gui/

    These should be set to a value of 1 to enable them. For example, in an Anaconda Prompt terminal:

Note

Only CONDA_DLL_SEARCH_MODIFICATION_ENABLE should be set finally.

List of known software that installs Intel libraries to C:WindowsSystem32:

  • Amplitube, by IK Multimedia

  • ASIO4ALL, by Michael Tippach

If you find others, please let us know. If you're on this list and you want tofix things, let us know. In either case, the conda issue tracker athttps://github.com/conda/conda/issues is the best way to reach us.

This is a broad umbrella of errors with many causes. Here are some we've seen.

CondaHTTPError: HTTP 000 CONNECTION FAILED¶

If you're on Windows and you see this error, look a little further down in theerror text. Do you see something like this?:

The key part there is the last bit:

Conda is having problems because it can't find the OpenSSL libraries that it needs.

Cause¶

You may observe this error cropping up after a conda update. More recentversions of conda and more recent builds of Python are more strict aboutrequiring activation of environments. We're working on better error messages forthem, but here's the story for now. Windows relies on the PATH environmentvariable as the way to locate libraries that are not in the immediate folder,and also not in the C:WindowsSystem32 folder. Searching for libraries in thePATH folders goes from left to right. If you choose to put Anaconda's folders onPATH, there are several of them:

  • (install root)

  • (install root)/Library/mingw-w64/bin

  • (install root)/Library/usr/bin

  • (install root)/Library/bin

  • (install root)/Scripts

  • (install root)/bin

  • (install root)/condabin

Early installers for Anaconda put these on PATH. That was ultimately fragilebecause Anaconda isn't the only software on the system. If other software hadsimilarly named executables or libraries, and came earlier on PATH, Anacondacould break. On the flip side, Anaconda could break other software if Anacondawere earlier in the PATH order and shadowed any other executables or libraries.To make this easier, we began recommending 'activation' instead of modifyingPATH. Activation is a tool where conda sets your PATH, and also runs any custompackage scripts which are often used to set additional environment variablesthat are necessary for software to run (e.g. JAVA_HOME). Because activation runsonly in a local terminal session (as opposed to the permanent PATH entry), it issafe to put Anaconda's PATH entries first. That means that Anaconda's librariesget higher priority when you're running Anaconda but Anaconda doesn't interferewith other software when you're not running Anaconda.

Anaconda's Python interpreter included a patch for a long time that added the(install root)/Library/bin folder to that Python's PATH. Unfortunately, thisinterfered with reasoning about PATH at all when using that Python interpreter.We removed that patch in Python 3.7.0, and we regret that this has causedproblems for people who are not activating their environments and who otherwisedo not have the proper entries on PATH. We're experimenting with approaches thatwill allow our executables to be less dependent on PATH and more self-aware oftheir needed library load paths. For now, though, the only solutions to thisproblem are to manage PATH properly.

Conda

Our humble opinion is that activation is the easiest way to ensure that thingswork. See more information on activation in Activating environments.

Solution¶

Use 'Anaconda Prompt' or shells opened from Anaconda Navigator. If you use a GUIIDE and you see this error, ask the developers of your IDE to add activation forconda environments.

SSL certificate errors¶

Cause¶

Installing packages may produce a 'connection failed' error if you do not havethe certificates for a secure connection to the package repository.

Solution¶

Pip can use the --trusted-host option to indicate that the URL of therepository is trusted:

Conda has three similar options.

  1. The option --insecure or -k ignores certificate validation errors for all hosts.

    Running condacreate--help shows:

  2. The configuration option ssl_verify can be set to False.

    Running condaconfig--describessl_verify shows:

    Running condaconfig--setssl_verifyfalse modifies ~/.condarc andsets the -k flag for all future conda operations performed by that user.Running condaconfig--help shows other configuration scope options.

    When using condaconfig, the user's conda configuration file at~/.condarc is used by default. The flag --system will instead writeto the system configuration file for all users at<CONDA_BASE_ENV>/.condarc. The flag --env will instead write to theactive conda environment's configuration file at<PATH_TO_ACTIVE_CONDA_ENV>/.condarc. If --env is used and noenvironment is active, the user configuration file is used.

  3. The configuration option ssl_verify can be used to install new certificates.

    Running condaconfig--describessl_verify shows:

    Your network administrator can give you a certificate bundle for yournetwork's firewall. Then ssl_verify can be set to the path of thatcertificate authority (CA) bundle and package installation operations willcomplete without connection errors.

    When using condaconfig, the user's conda configuration file at~/.condarc is used by default. The flag --system will instead writeto the system configuration file for all users at<CONDA_BASE_ENV>/.condarc. The flag --env will instead write to theactive conda environment's configuration file at<PATH_TO_ACTIVE_CONDA_ENV>/.condarc. If --env is used and noenvironment is active, the user configuration file is used.

SSL verification errors¶

Cause¶

This error may be caused by lack of activation on Windows or expiredcertifications:

Solution¶

Make sure your conda is up-to-date: conda--version

If not, run: condaupdateconda

Temporarily set your ssl_verify variable to false, upgrade the requests package, and thenset ssl_verify back to true using the following commands:

You can also set ssl_verify to a string path to a certificate, which can be used to verifySSL connections. Modify your .condarc and include the following:

Conda Cheat Sheet 4.8 Pdf

If the repository uses a self-signed certificate, use the actual path to the certificate.If the repository is signed by a private certificate authority (CA), the file needs to includethe root certificate and any intermediate certificates.

Cause¶

The umask command determines the mask settings that controlhow file permissions are set for newly created files. If youhave a very restrictive umask, such as 077, you get'permission denied' errors.

Solution¶

Set a less restrictive umask before calling conda commands.Conda was intended as a user space tool, but often users need touse it in a global environment. One place this can go awry iswith restrictive file permissions. Conda creates links when youinstall files that have to be read by others on the system.

To give yourself full permissions for files and directories butprevent the group and other users from having access:

  1. Before installing, set the umask to 007.

  2. Install conda.

  3. Return the umask to the original setting:

For more information on umask, seehttp://en.wikipedia.org/wiki/Umask.

Solution¶

Once you run conda with sudo, you must use sudo forever. We recommend that you NEVER run conda with sudo.

Cause¶

If you are trying to fix conda problems without removing thecurrent installation and you try to reinstall Miniconda orAnaconda to fix it, you get an error message that Minicondaor Anaconda is already installed and you cannot continue.

Solution¶

Install using the --force option.

Download and install the appropriate Minicondafor your operating system from the Miniconda download page using the force option--force or -f:

Note

Substitute the appropriate filename and version for youroperating system.

Note

Be sure that you install to the same location asyour existing install so it overwrites the core conda files anddoes not install a duplicate in a new folder.

Sometimes conda claims that a package is already installed butit does not appear to be, for example, a Python package thatgives ImportError.

There are several possible causes for this problem, each with itsown solution.

Cause¶

You are not in the same conda environment as your package.

Solution¶

  1. Make sure that you are in the same conda environment as yourpackage. The condainfo command tells you what environmentis currently active under defaultenvironment.

  2. Verify that you are using the Python from the correctenvironment by running:

Cause¶

For Python packages, you have set the PYTHONPATH or PYTHONHOMEvariable. These environment variables cause Python to load filesfrom locations other than the standard ones. Conda works bestwhen these environment variables are not set, as their typicaluse cases are obviated by conda environments and a common issueis that they cause Python to pick up the wrong or brokenversions of a library.

Solution¶

For Python packages, make sure you have not set the PYTHONPATHor PYTHONHOME variables. The command condainfo-a displaysthe values of these environment variables.

  • To unset these environment variables temporarily for thecurrent terminal session, run unsetPYTHONPATH.

  • To unset them permanently, check for lines in the files:

    • If you use bash---~/.bashrc, ~/.bash_profile,~/.profile.

    • If you use zsh---~/.zshrc.

    • If you use PowerShell on Windows, the file output by$PROFILE.

Cause¶

You have site-specific directories or, for Python, you haveso-called site-specific files. These are typically located in~/.local on macOS and Linux. For a full description of the locations ofsite-specific packages, see PEP 370. As withPYTHONPATH, Python may try importing packages from thisdirectory, which can cause issues.

Solution¶

For Python packages, remove site-specific directories andsite-specific files.

Cause¶

Conda cheat sheet 4.7

For C libraries, the following environment variables have beenset:

  • macOS---DYLD_LIBRARY_PATH.

  • Linux---LD_LIBRARY_PATH.

These act similarly to PYTHONPATH for Python. If they areset, they can cause libraries to be loaded from locations otherthan the conda environment. Conda environments obviate most usecases for these variables. The command condainfo-a showswhat these are set to.

Solution¶

Unset DYLD_LIBRARY_PATH or LD_LIBRARY_PATH.

Cause¶

Occasionally, an installed package becomes corrupted. Conda worksby unpacking the packages in the pkgs directory and thenhard-linking them to the environment. Sometimes these getcorrupted, breaking all environments that use them. Theyalso break any additional environments since the same files are hard-linkedeach time.

Solution¶

Run the command condainstall-f to unarchive the packageagain and relink it. It also does an MD5 verification on thepackage. Usually if this is different it is because yourchannels have changed and there is a different package with thesame name, version, and build number.

Note

This breaks the links to any other environments thatalready had this package installed, so you have to reinstall itthere, too. It also means that running condainstall-f a lotcan use up significant disk space if you have many environments.

Note

The -f flag to condainstall (--force) implies--no-deps, so condainstall-fpackage does not reinstallany of the dependencies of package.

Solution¶

Conda Cheat Sheet 4.8 Free

Force reinstall conda. A useful way to work off the developmentversion of conda is to run pythonsetup.pydevelop on acheckout of the conda GitHub repository. However, if you are notregularly running gitpull, it is a good idea to un-develop,as you will otherwise not get any regular updates to conda. Thenormal way to do this is to run pythonsetup.pydevelop-u.

However, this command does not replace the conda scriptitself. With other packages, this is not an issue, as you canjust reinstall them with conda, but conda cannot be used ifconda is installed.

The fix is to use the ./bin/conda executable in the condagit repository to force reinstall conda. That is, run./bin/condainstall-fconda. You can then verify withcondainfo that you have the latest version of conda, and nota git checkout. The version should not include any hashes.

Cause¶

This is a bug in the macOS Terminal app that shows up only incertain locales. Locales are country-language combinations.

Solution¶

  1. Open Terminal in /Applications/Utilities

  2. Clear the Set locale environment variables on startup checkbox.

This sets your LANG environment variable to be empty. This maycause Terminal to use incorrect settings for your locale. Thelocale command in Terminal tells you what settings are used.

To use the correct language, add a line to your bash profile,which is typically ~/.profile:

Conda Cheat Sheet 4.7

Note

Replace your-lang with the correct locale specifier foryour language.

The command locale-a displays all the specifiers. Forexample, the language code for US English is en_US.UTF-8. Thelocale affects what translations are used when they are availableand also how dates, currencies, and decimals are formatted.

When running a command such as condaupdateipython, you mayget an AttributeError:'module'objecthasnoattribute'getproxies'.

Cause¶

This can be caused by an old version of requests or by havingthe PYTHONPATH environment variable set.

Solution¶

Conda Cheat Sheet 4.8 Download

Update requests and be sure PYTHONPATH is not set:

  1. Run condainfo-a to show the requests version andvarious environment variables such as PYTHONPATH.

  2. Update the requests version withpipinstall-Urequests.

  3. Clear PYTHONPATH:

    • On Windows, clear it the environment variable settings.

    • On macOS and Linux, clear it by removing it from the bashprofile and restarting the shell.

When you run a command within a conda environment, conda does notaccess the correct package executable.

Cause¶

In both bash and zsh, when you enter a command, the shellsearches the paths in PATH one by one until it finds the command.The shell then caches the location, which is called hashing inshell terminology. When you run command again, the shell does nothave to search the PATH again.

The problem is that before you installed the program, you ran a command whichloaded and hashed another version of that program in some other location onthe PATH, such as /usr/bin. Then you installed the programusing condainstall, but the shell still had the old instancehashed.

Solution¶

Reactivate the environment or run hash-r (in bash) orrehash (in zsh).

Conda Cheat Sheet 4.8

When you run condaactivate, conda automatically runshash-r in bash and rehash in zsh to clear the hashedcommands, so conda finds things in the new path on the PATH. Butthere is no way to do this when condainstall is run becausethe command must be run inside the shell itself, meaning eitheryou have to run the command yourself or used a source file thatcontains the command.

This is a relatively rare problem, since this happens only in thefollowing circumstances:

  1. You activate an environment or use the root environment, andthen run a command from somewhere else.

  2. Then you condainstall a program, and then try to run theprogram again without running activate ordeactivate.

The command typecommand_name always tells you exactly whatis being run. This is better than whichcommand_name, whichignores hashed commands and searches the PATH directly.The hash is reset by condaactivate or by hash-r in bash orrehash in zsh.

Cause¶

After installing Anaconda or Miniconda, programs that runpython switch from invoking the system Python to invoking thePython in the root conda environment. If these programs rely onthe system Python to have certain configurations or dependenciesthat are not in the root conda environment Python, the programsmay crash. For example, some users of the Cinnamon desktopenvironment on Linux Mint have reported these crashes.

Solution¶

Edit your .bash_profile and .bashrc files so that theconda binary directory, such as ~/miniconda3/bin, is nolonger added to the PATH environment variable. You can still runcondaactivate and condadeactivate by using their fullpath names, such as ~/miniconda3/bin/conda.

You may also create a folder with symbolic links to condaactivateand condadeactivate and then edit your.bash_profile or .bashrc file to add this folder to yourPATH. If you do this, running python will invoke the systemPython, but running conda commands, condaactivateMyEnv,condaactivateroot, or condadeactivate will worknormally.

After running condaactivate to activate any environment,including after running condaactivateroot, runningpython will invoke the Python in the active conda environment.

Cause¶

Some conda package installation specifications are impossible tosatisfy. For example, condacreate-ntmppython=3wxpython=3produces an 'Unsatisfiable Specifications' error because wxPython3 depends on Python 2.7, so the specification to install Python 3conflicts with the specification to install wxPython 3.

When an unsatisfiable request is made to conda, conda shows amessage such as this one:

This indicates that the specification to install wxpython 3depends on installing Python 2.7, which conflicts with thespecification to install Python 3.

Solution¶

Conda Cheat Sheet 4.80

Use condainfowxpython or condainfowxpython=3 to showinformation about this package and its dependencies:

By examining the dependencies of each package, you should be ableto determine why the installation request produced a conflict andmodify the request so it can be satisfied without conflicts. Inthis example, you could install wxPython with Python 2.7:

Cause¶

Sometimes it is necessary to install a specific version from aspecific channel because that version is not available from thedefault channel.

Solution¶

The following example describes the problem in detail and itssolution.

Suppose you have a specific need to install the Pythoncx_freeze module with Python 3.4. A first step is to create aPython 3.4 environment:

Using this environment you should first attempt:

However, when you do this you get the following error:

The message indicates that cx_freeze cannot be found in thedefault package channels. However, there may be acommunity-created version available and you can search for it byrunning the following command:

In this example, there are 4 different places that you could tryto get the package. None of them are officially supported orendorsed by Anaconda, but members of the conda community haveprovided many valuable packages. If you want to go with publicopinion, then the web interface provides moreinformation:

Notice that the pyzo organization has by far the mostdownloads, so you might choose to use their package. If so, youcan add their organization's channel by specifying it on thecommand line:

Now you have a software environment sandbox created with Python3.4 and cx_freeze.

When making a Python package for an app, you create anenvironment for the app from a file req.txt that sets acertain version, such as python=2.7.9. However, when youcondainstall your package, it automatically upgrades to alater version, such as 2.7.10.

Cause¶

If you make a conda package for the app using conda-build, youcan set dependencies with specific version numbers. Therequirements lines that say -python could be-python2.7.9 instead. It is important to have 1 spacebefore the operator and no space after.

Solution¶

Exercise caution when coding version requirements.

Cause¶

Downgrading conda from 4.6.1 to 4.5.x and then trying to condainstallconda or condaupgradeconda will produce a solving and upgrade error similar to the following:

Solution¶

Change the .condarc file. Set the parameter by editing the .condarc file directly:allow_conda_downgrades:true in conda version 4.5.12. This will then let you upgrade. If you have something older than 4.5.12, install conda 4.6.1 again from the package cache.

EXAMPLE: If my conda info says package cache : /opt/conda/pkgs and my Python version is 3.7, then on the command line, type condainstall/opt/conda/pkgs/conda-4.6.1-py37_0.tar.bz2 to resolve the issue.

Cause¶

This happens when certain packages are installed with conda 4.3.28, and thenconda is downgraded to 4.3.27 or earlier.

Solution¶

See https://github.com/conda/conda/issues/6096.

Example: UnicodeDecodeError: 'ascii' codec can't decode byte 0xd3 in position 1: ordinal not in range(128)

Cause¶

Python 2 is incapable of handling unicode properly, especially on Windows. In this case, if any character in your PATH env. var contains anything that is not ASCII then you see this exception.

Solution¶

Remove all non-ASCII from PATH or switch to Python 3.

Cause¶

You may receive a warning message if you have not activated your environment:

Cheat

Solution¶

If you receive this warning, you need to activate your environment.To do so on Windows, use the Anaconda Prompt shortcut in your Windowsstart menu. If you have an existing cmd.exe session that you’d like toactivate conda in, run:call<youranaconda/minicondainstalllocation>Scriptsactivatebase.

Cause¶

PATH does not contain entries for all of the necessary conda directories.PATH may have too many entries from 3rd party software adding itself toPATH at install time, despite the user not needing to run the software via PATH lookup.

Solution¶

Strip PATH to have fewer entries and activate your environment.

If there's some software that needs to be found on PATH (you run it viathe CLI), we recommend that you create your own batch files to set PATHdynamically within a console session, rather than permanently modifyingPATH in the system settings.

For example, a new conda prompt batch file that first strips PATH, thencalls the correct activation procedure could look like:

If you need to run 3rd party software (software other than Windowsbuilt-ins and Anaconda) from this custom conda prompt, then you should addthose entries (and only those strictly necessary) to the set PATH entryabove. Note that only the quotes wrapping the entire expression should bethere. That is how variables are properly set in batch scripts, and theseaccount for any spaces in any entries in PATH. No additional quotes shouldbe within the value assigned to PATH.

To make 3rd party software take precedence over the same-named programsas supplied by conda, add it to PATH after activating conda:

To make conda software take precedence, call the activation script last.Because activation prepends the conda environment PATH entries,they have priority.