Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does conda create try to install weird packages?

I am trying to install a new conda environment that will be totally separate from my other environments, so I run:

conda create --name foot35 python=3.5

Anaconda then asks for my approval to install these NEW packages:

asn1crypto:      0.22.0-py35he3634b9_1
ca-certificates: 2017.08.26-h94faf87_0
cachecontrol:    0.12.3-py35h3f82863_0
certifi:         2017.7.27.1-py35hbab57cd_0
cffi:            1.10.0-py35h4132a7f_1
chardet:         3.0.4-py35h177e1b7_1
colorama:        0.3.9-py35h32a752f_0
cryptography:    2.0.3-py35h67a4558_1
distlib:         0.2.5-py35h12c42d7_0
html5lib:        0.999999999-py35h79d4e7f_0
idna:            2.6-py35h8dcb9ae_1
lockfile:        0.12.2-py35h667c6d9_0
msgpack-python:  0.4.8-py35hdef45cb_0
openssl:         1.0.2l-vc14hcac20b0_2      [vc14]
packaging:       16.8-py35h5fb721f_1
pip:             9.0.1-py35h69293b5_3
progress:        1.3-py35ha84af61_0
pycparser:       2.18-py35h15a15da_1
pyopenssl:       17.2.0-py35hea705d1_0
pyparsing:       2.2.0-py35hcabcaab_1
pysocks:         1.6.7-py35hb30ac0d_1
python:          3.5.4-hedc2606_15
requests:        2.18.4-py35h54a615f_1
setuptools:      36.5.0-py35h21a22e4_0
six:             1.10.0-py35h06cf344_1
urllib3:         1.22-py35h8cc84eb_0
vc:              14-h2379b0c_1
vs2015_runtime:  14.0.25123-hd4c4e62_1
webencodings:    0.5.1-py35h5d527fb_1
wheel:           0.29.0-py35hdbcb6e6_1
win_inet_pton:   1.0.1-py35hbef1270_1
wincertstore:    0.2-py35hfebbdb8_0

I don't know why it suggests these specific ones. I looked up lockfile and its website says:

Note: This package is deprecated.

Here is a screenshot of my command prompt as additional information.

I am trying to do a clean install that is unrelated/independent to the root environment.

Why is conda trying to install these things and how do I fix it?

like image 349
user1367204 Avatar asked Oct 03 '17 14:10

user1367204


People also ask

Should you install packages in conda base?

Avoid installing packages into your base Conda environment Conda has a default environment called base that include a Python installation and some core system libraries and dependencies of Conda. It is a “best practice” to avoid installing additional packages into your base software environment.

Is pip install better than conda install?

It's fully recommended to use pip inside of conda. It's better to install using conda, but for any packages that don't have a conda build, it's perfectly acceptable to use pip.

Does conda conflict with pip?

Conda analyzes each package for compatible dependencies, and how to install them without conflict. If there is a conflict, Conda will let you know that the installation cannot be completed. By comparison, Pip installs all package dependencies regardless of whether they conflict with other packages already installed.

Why is conda so much slower than pip?

Why such a difference to download the same library? The Conda User Guide offers one possible reason for poor performance: Unlike many package managers, Anaconda's repositories generally don't filter or remove old packages from the index. This allows old environments to be easily recreated.


2 Answers

conda create will "Create a new conda environment from a list of specified packages." ( https://conda.io/docs/commands/conda-create.html )

What list??!? The .condarc file is the conda configuration file.

https://conda.io/docs/user-guide/configuration/use-condarc.html#overview

The .condarc file can change many parameters, including:

Where conda looks for packages.
If and how conda uses a proxy server.
Where conda lists known environments.
Whether to update the bash prompt with the current activated environment name.
Whether user-built packages should be uploaded to Anaconda.org.
**Default packages or features to include in new environments.**

Additionally, if you ever typed conda config, even accidentally...

The .condarc file is not included by default, but it is automatically created in your home directory the first time you run the conda config command.

A .condarc file may also be located in the root environment, in which case it overrides any in the home directory.

If you would like a single clean env then Boshika's recommendation of --no-default-packages flag for an instance though, you can check and modify the default packages for all further envs. ( https://conda.io/docs/user-guide/configuration/use-condarc.html#always-add-packages-by-default-create-default-packages )

Always add packages by default (create_default_packages)
When creating new environments, add the specified packages by default. The default packages are installed in every environment you create. You can override this option at the command prompt with the --no-default-packages flag. The default is to not include any packages.

EXAMPLE:

create_default_packages:
  - pip
  - ipython
  - scipy=0.15.0

Lockfile may be there due to legacy requirements across all operating systems. Hopefully, you have the tools to remove it if you choose.

like image 83
Rookie Avatar answered Sep 17 '22 15:09

Rookie


To avoid conda from installing all default packages you can try this

 conda create --name foot35 --no-deps python=3.5
like image 31
Boshika Tara Avatar answered Sep 18 '22 15:09

Boshika Tara