1 year ago

#215879

test-img

Griffin

Broke my conda. Can't install packages from custom channel any longer

I've inherited a machine, with an Anaconda installation, on which I must manage my python environments.

I have a custom channel, on a network share, that I host my conda packages on. It has the highest priority.

Everything was working to my satisfaction, except that conda update -n base -c defaults conda has become extremely slow. Sometimes I have to kill it after a few hours.

After looking for solutions to speed up environment solve, I edited my conda config by doing:

conda config --set channel_priority strict
conda config --set default_threads 4

Neither of which helped, so I reverted to my previous conda config settings.

Now, when I try to update/install a package from my channel to any environment it fails. Installing standard packages like numpy still works.

To keep things simple, I have created a "scratch" environment with python only. It contains:

# packages in environment at C:\ProgramData\Anaconda3\envs\scratch:
#
# Name                    Version                   Build  Channel
ca-certificates           2021.10.26           haa95532_4
certifi                   2021.10.8        py39haa95532_2
openssl                   1.1.1m               h2bbff1b_0
pip                       21.2.4           py39haa95532_0
python                    3.9.7                h6244533_1
setuptools                58.0.4           py39haa95532_0
sqlite                    3.37.2               h2bbff1b_0
tzdata                    2021e                hda174b7_0
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wheel                     0.37.1             pyhd3eb1b0_0
wincertstore              0.2              py39haa95532_2

I have a package foo_package, which conda sees on my channel:

(scratch) PS C:\Users\griffin> conda search foo_package
Loading channels: done
# Name                       Version           Build  Channel
foo_package                     1.0          py36_0  custom_packages
foo_package                     1.0          py37_0  custom_packages
foo_package                     1.0          py38_0  custom_packages
foo_package                     1.0          py39_0  custom_packages

When I try to install it:

(scratch) PS C:\Users\griffin> conda install foo_package
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - foo_package -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0']

Your python: python=3.9

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

I have no idea where it is getting that python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0'] dependency from. The meta data for my package is very simple:

package:
  name: foo_package
  version: 1.0

source:
  path: .

requirements:
  host:
    - python
  run:
    - python
    - redis-py

The same set up continues to work on my other machines. So I feel it must be something to do with the configuration.

I looked at all the possible places a condarc file could be. I found two, and they seemed contradictory. So I deleted them both and re-added my custom channel to the list.

But the issue persists. What can I do?

My current conda config looks like so:

(base) PS C:\Users\griffin> conda config --show
add_anaconda_token: True
add_pip_as_python_dependency: True
aggressive_update_packages:
  - ca-certificates
  - certifi
  - openssl
allow_conda_downgrades: False
allow_cycles: True
allow_non_channel_urls: False
allow_softlinks: False
always_copy: False
always_softlink: False
always_yes: None
anaconda_upload: None
auto_activate_base: True
auto_stack: 0
auto_update_conda: True
bld_path:
changeps1: True
channel_alias: https://conda.anaconda.org
channel_priority: flexible
channels:
  - N:\path\to\channel\custom_packages
  - defaults
client_ssl_cert: None
client_ssl_cert_key: None
clobber: False
conda_build: {}
create_default_packages: []
croot: C:\ProgramData\Anaconda3\conda-bld
custom_channels:
  pkgs/main: https://repo.anaconda.com
  pkgs/r: https://repo.anaconda.com
  pkgs/msys2: https://repo.anaconda.com
  pkgs/pro: https://repo.anaconda.com
custom_multichannels:
  defaults:
    - https://repo.anaconda.com/pkgs/main
    - https://repo.anaconda.com/pkgs/r
    - https://repo.anaconda.com/pkgs/msys2
  local:
debug: False
default_channels:
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - https://repo.anaconda.com/pkgs/msys2
default_python: 3.7
default_threads: None
deps_modifier: not_set
dev: False
disallowed_packages: []
download_only: False
dry_run: False
enable_private_envs: False
env_prompt: ({default_env})
envs_dirs:
  - C:\ProgramData\Anaconda3\envs
  - C:\Users\griffin\.conda\envs
  - C:\Users\griffin\AppData\Local\conda\conda\envs
error_upload_url: https://conda.io/conda-post/unexpected-error
execute_threads: 1
extra_safety_checks: False
force: False
force_32bit: False
force_reinstall: False
force_remove: False
ignore_pinned: False
json: False
local_repodata_ttl: 1
migrated_channel_aliases: []
migrated_custom_channels: {}
non_admin_enabled: True
notify_outdated_conda: True
offline: False
override_channels_enabled: True
path_conflict: clobber
pinned_packages: []
pip_interop_enabled: False
pkgs_dirs:
  - C:\ProgramData\Anaconda3\pkgs
  - C:\Users\griffin\.conda\pkgs
  - C:\Users\griffin\AppData\Local\conda\conda\pkgs
proxy_servers: {}
quiet: False
remote_backoff_factor: 1
remote_connect_timeout_secs: 9.15
remote_max_retries: 3
remote_read_timeout_secs: 60.0
repodata_fns:
  - current_repodata.json
  - repodata.json
repodata_threads: None
report_errors: None
restore_free_channel: False
rollback_enabled: True
root_prefix: C:\ProgramData\Anaconda3
safety_checks: warn
sat_solver: pycosat
separate_format_cache: False
shortcuts: True
show_channel_urls: None
signing_metadata_url_base: None
solver_ignore_timestamps: False
ssl_verify: True
subdir: win-64
subdirs:
  - win-64
  - noarch
target_prefix_override:
track_features: []
unsatisfiable_hints: True
unsatisfiable_hints_check_depth: 2
update_modifier: update_specs
use_index_cache: False
use_local: False
use_only_tar_bz2: True
verbosity: 0
verify_threads: 1
whitelist_channels: []

python

windows

anaconda

conda

conda-build

0 Answers

Your Answer

Accepted video resources