尝试安装 pychrono 时出现 anaconda/conda UnsatisfiableError - 无法满足 python 版本规范

问题描述 投票:0回答:2

第一篇文章。我正在尝试通过 anaconda 提示符中的这些命令(使用 Windows 11)安装 pychrono (https://projectchrono.org/pychrono/)。

conda create --name pychrono311 python=3.11
conda activate pychrono311
conda install -c projectchrono pychrono

我收到这样的回复:

Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.
failed

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

Specifications:

  - pychrono -> python[version='>=3.10,<3.11.0a0|>=3.8,<3.9.0a0|>=3.9,<3.10.0a0']

Your python: python=3.11

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.

因此,根据我看到的版本规格,我停用并尝试(我认为)是受支持的Python版本:

conda deactivate
conda env remove --name pychrono311
conda create --name pychrono310 python=3.10
conda activate pychrono310
conda install -c projectchrono pychrono

但是,我得到了这样的回应:

...
Specifications:

  - pychrono -> python[version='>=3.11,<3.12.0a0|>=3.12,<3.13.0a0']

Your python: python=3.10

我尝试了其他各种Python版本(3.9、3.8),结果是一样的。

我在这里缺少什么?看来是无法满足要求了。我是否缺少参数或更高级的版本号?要求发生变化的事实也很奇怪。

python package anaconda conda version
2个回答
0
投票

作为一种解决方法,当您找到如何解决主机上的问题并且如果您可以使用 docker 时,您可以使用 pychrono 提供的 docker 镜像:

docker pull uwsbel/projectchrono:latest

重现错误


我已尝试重现您的问题。

使用 condaforge/miniforge3 docker 镜像(conda 23.3.1),我按照以下指示进行操作:https://api.projectchrono.org/pychrono_installation.html

conda create -n chrono python=3.9
conda activate chrono

然后按照给定的顺序安装以下软件包,然后再安装 PyChrono conda 软件包(参见安装说明):

conda install -c conda-forge mkl=2020
conda install -c conda-forge numpy=1.24.0
conda install -c conda-forge irrlicht=1.8.5
conda install -c conda-forge pythonocc-core=7.4.1

然后安装pychrono:

conda install -c projectchrono pychrono

没有给出错误。

下一个


您的 conda 频道或 conda 安装可能有问题。 如果您给我您的 conda 版本以及安装方式,我也许能够重现并为您提供更多帮助。


0
投票

检查最新

projectchrono::pychrono
构建时的通道配置1,我看到以下内容:

{
  "channels": [
    "https://conda.anaconda.org/intel",
    "https://conda.anaconda.org/conda-forge",
    "https://repo.anaconda.com/pkgs/main",
    "https://conda.anaconda.org/intel",
    "https://conda.anaconda.org/conda-forge",
    "https://conda.anaconda.org/dlr-sc"
  ],...}

Conda 的一个技巧是,确实需要使用与所用包相同的通道配置才能确保其正常工作。在这种情况下,这更容易编码为 YAML。

pychrono310.yaml

name: pychrono310
channels:
  - intel
  - conda-forge
  - main
  - dlr-sc
  ## NB: I've dropped the redundant ones
dependencies:
  ## OP was correct about no Python 3.11 support
  - python=3.10
  - pychrono

这对我的测试很有用:

conda env create -n pychrono310 -f pychrono310.yaml

[1]: 通过从 Anaconda Cloud 下载 tarball 并检查

info/about.json
文件可以找到此信息。

© www.soinside.com 2019 - 2024. All rights reserved.