Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between "conda install" with "-c anaconda" and without it

I am new to python and I am trying to install new packages in Anaconda. I am using anaconda prompt and Windows 10.

  1. Can you please explain what is the difference between conda install with -c anaconda and without it? For example conda install -c anaconda mysqlclient and conda install mysqlclient.
  2. Which is better to use when and why?
like image 994
vasili111 Avatar asked Jan 28 '20 22:01

vasili111


People also ask

What is the difference between Anaconda and conda?

Conda is a package manager. It helps you take care of your different packages by handling installing, updating and removing them. Anaconda contains all of the most common packages (tools) a data scientist needs and can be considered the hardware store of data science tools.

Is conda installed with Anaconda?

The conda package and environment manager is included in all versions of Anaconda and Miniconda. Conda is also included in Anaconda Enterprise, which provides on-site enterprise package and environment management for Python, R, Node.

Can I install conda without Anaconda?

No, this is not possible: Currently supported install methods include the Anaconda installer and the miniconda installer. You will either need to install miniconda/anaconda, or use another package manager.

What does C mean in conda install?

-c stands for --channel . It's used to specify a channel where to search for your package, the channel is often named owner. The generic command is: conda install -c CHANNEL_NAME PACKAGE_NAME.


2 Answers

conda, as you know is a package manager that can install packages to your machine. If you do conda install, it needs a place to search for these packages to download them from. For conda, this is solved with the concept of channels, which are, as @David Kabii has pointed out, like repositories that can exist either locally/a network location or be a url. By default, conda install will try to download packages from repo.anaconda.com, specifically on windows, these locations are searched by default:

  • https://repo.anaconda.com/pkgs/main/win-64
  • https://repo.anaconda.com/pkgs/main/noarch
  • https://repo.anaconda.com/pkgs/r/win-64
  • https://repo.anaconda.com/pkgs/r/noarch
  • https://repo.anaconda.com/pkgs/msys2/win-64
  • https://repo.anaconda.com/pkgs/msys2/noarch

More information on the difference can be found in the docs on using default repositories.

Now if you go to www.anaconda.org and search for a package, let's say numpy, you will see that it is available from different channels. You should only worry about those in case a package is not available from the default channels. This you can also check by running conda search <package name> which will list all available versions in the currently configured channels.

Coming to your question. The -c options specifies an additional channel to search first which is needed if a package is not available from default channels. E.g. some bioinformatics tools are only available by specifying -c bioconda. For those packages that are available from the default channels you should not specify anything and using -c anaconda will make no difference, as the anaconda channel is only a mirror of the default ones and should not be used (see the channel description):

This channel is used internally for mirroring. You should very much prefer https://repo.anaconda.com, which is conda's default and needs no "-c" setting.

like image 72
FlyingTeller Avatar answered Oct 16 '22 19:10

FlyingTeller


When you use the -c option, you are specifying the channel from which to get the package. The default is -c anaconda, so they are similar. To use packages built locally, you would use -c local. Here is a link for more info: Docs explaining usage of conda install

like image 4
David Kabii Avatar answered Oct 16 '22 18:10

David Kabii