0

我创建了一个对 Python 版本没有特别要求的包,当我使用 Python 3.8 创建 conda 环境时,它告诉我只有在我将 Python 版本更改为其他任何版本时才会安装,但 Python 3.8,当我尝试使用它时3.9,例如,然后它告诉我只有当我的 Python 版本是 3.8 时才能安装我的包。

不用说,--no-deps在这种情况下什么都做不了。当我从 package.tar.bz2 中查找元数据时,我可以看到它conda添加了一堆从未存在过的需求(特别是它添加了 Python 版本)。

下面是我能够从中获取的一个真正愚蠢的错误消息,从conda本质上讲,它声称一切都是 honky-dory,但无论如何它都失败了:

Collecting package metadata (current_repodata.json): ...working... Unable to retrieve repodata (response: 404) for https://conda.anaconda.org/<snip>/linux-64/current_repodata.json

done
Solving environment: ...working... failed with initial frozen solve. Retrying with flexible solve.
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... failed with initial frozen solve. Retrying with flexible solve.
Solving environment: ...working... 
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed                                                                                                                                                                                                                                                                         
Traceback (most recent call last):
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/cli/install.py", line 261, in install
    unlink_link_transaction = solver.solve_for_transaction(
  File "/home/wvxvw/anaconda3/lib/python3.8/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 "/home/wvxvw/anaconda3/lib/python3.8/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 "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 281, in solve_final_state
    ssc = self._run_sat(ssc)
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/common/io.py", line 88, in decorated
    return f(*args, **kwds)
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 815, in _run_sat
    ssc.solution_precs = ssc.r.solve(tuple(final_environment_specs),
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/common/io.py", line 88, in decorated
    return f(*args, **kwds)
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/resolve.py", line 1320, in solve
    raise UnsatisfiableError({})
conda.exceptions.UnsatisfiableError: 
Did not find conflicting dependencies. If you would like to know which
packages conflict ensure that you have enabled unsatisfiable hints.

conda config --set unsatisfiable_hints True
            

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1079, in __call__
    return func(*args, **kwargs)
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/cli/main.py", line 84, in _main
    exit_code = do_call(args, p)
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/cli/conda_argparse.py", line 83, in do_call
    return getattr(module, func_name)(args, parser)
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/cli/main_install.py", line 20, in execute
    install(args, parser, 'install')
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/cli/install.py", line 308, in install
    raise e
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/cli/install.py", line 295, in install
    unlink_link_transaction = solver.solve_for_transaction(
  File "/home/wvxvw/anaconda3/lib/python3.8/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 "/home/wvxvw/anaconda3/lib/python3.8/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 "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 275, in solve_final_state
    ssc = self._add_specs(ssc)
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/core/solve.py", line 704, in _add_specs
    ssc.r.find_conflicts(spec_set)
  File "/home/wvxvw/anaconda3/lib/python3.8/site-packages/conda/resolve.py", line 352, in find_conflicts
    raise UnsatisfiableError(bad_deps, strict=strict_channel_priority)
conda.exceptions.UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - <snip> -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.9,<3.10.0a0']

Your python: python=3.8

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.

顺便说一句,我确实启用了报告无法满足的依赖项,但这并不重要。

4

0 回答 0