如何解决无论python版本如何,conda都拒绝安装
我创建了一个对 Python 版本没有特别要求的包,当我使用 Python 3.8 创建 conda 环境时,它告诉我只有当我将 Python 版本更改为其他任何版本时才会安装它,但 Python 3.8,当我比如用3.9试试,然后告诉我我的包只有Python版本是3.8才能安装。
不用说,--no-deps
在这种情况下什么都不做。当我从 package.tar.bz2 中查找元数据时,我可以看到 conda
添加了一堆从未存在的要求(特别是它添加了 Python 版本)。
下面是我能够从 conda
请求的真正愚蠢的错误消息,它本质上声称一切都是愚蠢的,但无论如何它都失败了:
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,prune,ignore_pinned,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",**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,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.
顺便说一下,我确实启用了无法满足的依赖项的报告,但这并不重要。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。