简体   繁体   中英

conda build: ResolvePackageNotFound depending on machine

I'm building a custom conda package with that depends on four other packages from a custom channel. When I try conda build . on machine A, these packages are reported as unsatifiable (see below). On machine B, with the same commit, conda build works.

I cloned the working build environment from machine B to machine A without success.

The custom channel is in a network directory. Installing the problematic packages from it works on both machines. It only seems unreachable for conda build on machine A for some reason.

(Bottom of) conda build 's error message on machine A:

Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda_build\environ.py", line 799, in get_install_actions
    actions = install_actions(prefix, index, specs, force=True)
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\common\io.py", line 88, in decorated
    return f(*args, **kwds)
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\plan.py", line 474, in install_actions
    txn = solver.solve_for_transaction(prune=prune, ignore_pinned=not pinned)
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\core\solve.py", line 114, in solve_for_transaction
    unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\core\solve.py", line 157, in solve_for_diff
    final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\core\solve.py", line 275, in solve_final_state
    ssc = self._add_specs(ssc)
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\core\solve.py", line 565, in _add_specs
    explicit_pool = ssc.r._get_package_pool(self.specs_to_add)
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\resolve.py", line 555, in _get_package_pool
    pool = self.get_reduced_index(specs)
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\common\io.py", line 88, in decorated
    return f(*args, **kwds)
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\resolve.py", line 576, in get_reduced_index
    explicit_specs, features = self.verify_specs(explicit_specs)
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda\resolve.py", line 288, in verify_specs
    raise ResolvePackageNotFound(bad_deps)
conda.exceptions.ResolvePackageNotFound:
- customA=4.7.0
- customB=0.2.1
- customC=0.5.0
- customD=10.4.3

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\ProgramData\Miniconda3\envs\build2\Scripts\conda-build-script.py", line 10, in <module>
    sys.exit(main())
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda_build\cli\main_build.py", line 488, in main
    execute(sys.argv[1:])
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda_build\cli\main_build.py", line 477, in execute
    outputs = api.build(args.recipe, post=args.post, test_run_post=args.test_run_post,
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda_build\api.py", line 186, in build
    return build_tree(
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda_build\build.py", line 3088, in build_tree
    packages_from_this = build(metadata, stats,
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda_build\build.py", line 2128, in build
    create_build_envs(top_level_pkg, notest)
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda_build\build.py", line 2006, in create_build_envs
    raise e
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda_build\build.py", line 1985, in create_build_envs
    environ.get_install_actions(m.config.test_prefix,
File "C:\ProgramData\Miniconda3\envs\build2\lib\site-packages\conda_build\environ.py", line 801, in get_install_actions
    raise DependencyNeedsBuildingError(exc, subdir=subdir)
conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform win-64: {'customB=0.2.1', 'customC=0.5.0', 'customD=10.4.3', 'customA=4.7.0'}

conda config (machine B):

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:
- open3d-admin
- file:////custom/channel
- conda-forge
- defaults
client_ssl_cert: None
client_ssl_cert_key: None
clobber: False
conda_build: {}
create_default_packages: []
croot: C:\ProgramData\Miniconda3\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.8
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\Miniconda3\envs
- C:\Users\JPoppinga\.conda\envs
- C:\Users\JPoppinga\AppData\Local\conda\conda\envs
error_upload_url: https://conda.io/conda-post/unexpected-error
execute_threads: 1
experimental_solver: classic
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\Miniconda3\pkgs
- C:\Users\JPoppinga\.conda\pkgs
- C:\Users\JPoppinga\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\Miniconda3
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: False
verbosity: 0
verify_threads: 1
whitelist_channels: []

conda config machine A, diffed to machine B's:

49c49
< default_python: 3.7
---
> default_python: 3.8
60,61c60,61
<   - H:\.conda\envs
<   - C:\Users\jpoppinga\AppData\Local\conda\conda\envs
---
>   - C:\Users\JPoppinga\.conda\envs
>   - C:\Users\JPoppinga\AppData\Local\conda\conda\envs
84,85c84,85
<   - H:\.conda\pkgs
<   - C:\Users\jpoppinga\AppData\Local\conda\conda\pkgs
---
>   - C:\Users\JPoppinga\.conda\pkgs
>   - C:\Users\JPoppinga\AppData\Local\conda\conda\pkgs

conda info machine B:

    active environment : build
    active env location : C:\ProgramData\Miniconda3\envs\build
            shell level : 2
      user config file : C:\Users\JPoppinga\.condarc
populated config files : C:\Users\JPoppinga\.condarc
          conda version : 4.13.0
    conda-build version : not installed
        python version : 3.8.8.final.0
      virtual packages : __win=0=0
                          __archspec=1=x86_64
      base environment : C:\ProgramData\Miniconda3  (writable)
      conda av data dir : C:\ProgramData\Miniconda3\etc\conda
  conda av metadata url : None
          channel URLs : https://conda.anaconda.org/open3d-admin/win-64
                          https://conda.anaconda.org/open3d-admin/noarch
                          file://custom/channel
                          file://custom/channel
                          https://conda.anaconda.org/conda-forge/win-64
                          https://conda.anaconda.org/conda-forge/noarch
                          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
          package cache : C:\ProgramData\Miniconda3\pkgs
                          C:\Users\JPoppinga\.conda\pkgs
                          C:\Users\JPoppinga\AppData\Local\conda\conda\pkgs
      envs directories : C:\ProgramData\Miniconda3\envs
                          C:\Users\JPoppinga\.conda\envs
                          C:\Users\JPoppinga\AppData\Local\conda\conda\envs
              platform : win-64
            user-agent : conda/4.13.0 requests/2.27.1 CPython/3.8.8 Windows/10 Windows/10.0.19041
          administrator : False
            netrc file : None
          offline mode : False

Machine A's conda info diffed to machine B's:

2,3c2,3
<      active environment : build2
<     active env location : C:\ProgramData\Miniconda3\envs\build2
---
>      active environment : build
>     active env location : C:\ProgramData\Miniconda3\envs\build
5,6c5,6
<        user config file : H:\.condarc
<  populated config files : H:\.condarc
---
>        user config file : C:\Users\JPoppinga\.condarc
>  populated config files : C:\Users\JPoppinga\.condarc
9c9
<          python version : 3.7.4.final.0
---
>          python version : 3.8.8.final.0
28,29c28,29
<                           H:\.conda\pkgs
<                           C:\Users\jpoppinga\AppData\Local\conda\conda\pkgs
---
>                           C:\Users\JPoppinga\.conda\pkgs
>                           C:\Users\JPoppinga\AppData\Local\conda\conda\pkgs
31,32c31,32
<                           H:\.conda\envs
<                           C:\Users\jpoppinga\AppData\Local\conda\conda\envs
---
>                           C:\Users\JPoppinga\.conda\envs
>                           C:\Users\JPoppinga\AppData\Local\conda\conda\envs
34c34
<              user-agent : conda/4.13.0 requests/2.28.1 CPython/3.7.4 Windows/10 Windows/10.0.19041
---
>              user-agent : conda/4.13.0 requests/2.27.1 CPython/3.8.8 Windows/10 Windows/10.0.19041

Edit: I found out it works if I use conda build -c file:////custom/channel . . I still don't get why this should be necessary, as the channel shows up in conda config , conda env export , and conda info . I tried removing it with conda config --remove channels file:////custom/channel and re-adding it with conda config --add channels file:////custom/channel , but the simple conda build . still fails.

I found out what the problem was. It has to do with my employer's network set-up. We normally use VPN and when in that VPN, the user home directory (ie the $HOME environment variable) is set to the network drive H: . The other day, I couldn't connect to VPN. This means that a) the user home directory is the standard C:\Users\<Username> and b) I could not connect to the custom conda channel. In fact, I could not do anything with conda, as it would always error out because of that channel being unreachable. So I removed it via conda config , which removed it from C:\Users\<Username>\.condarc . I then remembered that rebooting fixes the VPN issue and rebooted. When the computer was back up and in the VPN, I was not sure if I had actually removed the channel (or if I had remembered the solution before getting around doing it), so I checked via conda config . Only that now, it referred to H:\.condarc , which still had the channel. So I just continued working as normal, expecting conda build to still work.

However, the result was a setup where conda install could still access the custom channel (it must use the $HOME environment variable to find the .condarc ) and conda build couldn't (it must use C:\users\<Username> directly).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM