gpt4 book ai didi

python - Anaconda:从 PyPi 包构建时出错 ("Package XY missing in current linux-64 channels")

转载 作者:太空宇宙 更新时间:2023-11-03 16:39:10 35 4
gpt4 key购买 nike

我正在尝试构建 open energy modelling framework (oemof) PyPi package 的 conda 包如相应manual中所述。 oemof 包有 Pyomo包作为我预先使用合适的 recipe 安装的要求.

我的问题是我现在在构建过程中遇到错误:

 Package missing in current linux-64 channels: 
- pyomo >=4.2.0

而我安装的 Pyomo 版本似乎高于 4.2:

cord@crd-Laptop:~/.anaconda3/bin$ ./conda update pyomo
pyomo 4.2.10784 py35_10 cachemeorg

我的错误是什么?如何按照 conda 手册中的描述构建我的包?

提前致谢!

下面您可以看到我到目前为止所经历的步骤:

cord@crd-Laptop:~/.anaconda3/bin$ ./conda skeleton pypi oemof
Warning, the following versions were found for oemof
0.0.6
0.0.5
0.0.4
0.0.3
Using 0.0.6
Use --version to specify a different version.
Using url https://pypi.python.org/packages/3b/1f/5a82acf8cbcb3d0adb537346b2939cb6fa415e9c347f734af19c8a1b50d1/oemof-0.0.6.tar.gz (52 KB) for oemof.
Downloading oemof
Using cached download
Unpacking oemof...
done
working in /tmp/tmpd67mbpi2conda_skeleton_oemof-0.0.6.tar.gz
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .........

The following NEW packages will be INSTALLED:

mkl: 11.3.1-0
numpy: 1.11.0-py35_0
openssl: 1.0.2g-0
pip: 8.1.1-py35_1
python: 3.5.1-0
pyyaml: 3.11-py35_1
readline: 6.2-2
setuptools: 20.7.0-py35_0
sqlite: 3.9.2-0
tk: 8.5.18-0
wheel: 0.29.0-py35_0
xz: 5.0.5-1
yaml: 0.1.6-0
zlib: 1.2.8-0

Linking packages ...
[ COMPLETE ]|###########################################################################################| 100%
Applying patch: '/tmp/tmpd67mbpi2conda_skeleton_oemof-0.0.6.tar.gz/pypi-distutils.patch'
patching file core.py
Hunk #1 succeeded at 167 with fuzz 2 (offset 1 line).
Using "UNKNOWN" for the license
Writing recipe for oemof
Done

cord@crd-Laptop:~/.anaconda3/bin$ ./conda build oemof
Removing old build environment
Removing old work directory
BUILD START: oemof-0.0.6-py35_0
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ......
Solving package specifications: .
Package missing in current linux-64 channels:
- pyomo >=4.2.0
Missing dependency pyomo, but found recipe directory, so building pyomo first
Ignoring non-recipe: pyomo
Removing old build environment
Removing old work directory
BUILD START: oemof-0.0.6-py35_0
Fetching package metadata: ......
Solving package specifications: .
Package missing in current linux-64 channels:
- pyomo >=4.2.0

cord@crd-Laptop:~/.anaconda3/bin$ ./conda update pyomo
Using Anaconda Cloud api site https://api.anaconda.org
Fetching package metadata: ....
# All requested packages already installed.
# packages in environment at /home/cord/.anaconda3:
#
pyomo 4.2.10784 py35_10 cachemeorg
cord@crd-Laptop:~/.anaconda3/bin$

最佳答案

对于您的构建步骤,请尝试conda build -c cachemeorg oemof

我认为这里的问题是 conda build 在构建时创建了一个全新的 conda 环境,并且它将在该环境中安装所有包依赖项,包括 pyomo。它通过在 channel 中查找它们来安装它们,而不是通过根目录中当前安装的软件包来安装它们。在此示例中,您已将 pyomo 作为软件包安装,但它并非来自 channel 列表中的 channel ,因为您自己安装了它。因此,在搜索 conda channel 时,它无法找到 pyomo 包。但是,如果我们将一个 channel 添加到 conda build 正在查看的列表中(通过 -c 标志),其中包含 pyomo 那么它应该可以工作。看起来cachemeorg有这个package因此上面的命令应该有效。

关于python - Anaconda:从 PyPi 包构建时出错 ("Package XY missing in current linux-64 channels"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36980791/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com