1

I installed miniconda via choco install miniconda3.

Creating a python3 environment works fine.

conda create --name envA python=3 --verbose

But creating a python2 environment has a problem.

conda create --name envB python=2 --verbose
Collecting package metadata (current_repodata.json): ...working... done
Solving environment: ...working... failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working...
Found conflicts! Looking for incompatible packages.
failed
Traceback (most recent call last):
...

File "C:\Users\fred\miniconda3\lib\site-packages\conda\resolve.py", line 352, in find_conflicts
    raise UnsatisfiableError(bad_deps, strict=strict_channel_priority)
conda.exceptions.UnsatisfiableError
phreed
  • 1,759
  • 1
  • 15
  • 30
  • 2
    in my experience, in the past these problems could often be solved by using mamba instead of conda, as it tends to give you better error messages. Generally speaking tho, python 2 is end-of-life and it might be hard to get it to work. – cel Apr 11 '22 at 19:54

1 Answers1

2

@cel gets credit for this

Switching to mamba provided better diagnostics.

mamba create -n foo python=2

Looking for: ['python=2']

conda-forge/win-64                                          Using cache
conda-forge/noarch                                          Using cache
Encountered problems while solving:
 - nothing provides vc 9.* needed by python-2.7.12-0

Then use mamba to find vc.

mamba search vc

# Name                       Version           Build  Channel
vc                              14.1      h21ff451_1  conda-forge
vc                              14.1      h6d1b3ff_2  conda-forge
...

The vc v9 can be found in the defaults channel.

mamba search 'vc[channel=defaults]'

# Name                       Version           Build  Channel
vc                                 9      h2eaa2aa_6  pkgs/main
...

Updating the .condarc with the defaults channel, corrected the problem.

channels:
  - conda-forge
  - defaults
channel_priority: disabled

As a final note, should someone else find themselves in this situation...

The ~/.condarc got changed (dropping the defaults channel) as part of installing mambaforge.

phreed
  • 1,759
  • 1
  • 15
  • 30
  • "*.condarc got damaged when I installed mambaforge*" - was it really damaged? or was it just replaced? Mambaforge is a Miniforge variant, which omits the **defaults** channel *by design*. Also, why was Mambaforge installed when there was already a Conda installation? – merv Apr 12 '22 at 11:49
  • Whether it is damaged or not depends on perspective. From the mambaforge perspective it is fine. From the miniconda3 perspective it is damaged. The issue is related to what to do with the ~/.condarc file when both miniconda3 and mambaforge are installed. What should the two packages do during installation? I would think the thing to do is to create default ~/miniconda3/.condarc ~/mambaforge/.condarc respectively which would be discovered before the ~/.condarc file. Of course that might introduce other problems. In any case I will change my comment. – phreed Apr 13 '22 at 18:06