在macOS上使用conda安装pyzbar时出错

问题描述 投票:1回答:1

我正在尝试将项目从Python 3 venv转换为Conda。但是,它不适用于Conda,显然是因为没有支持macOS的存储库。

这令人失望,因为在原始项目中使用brewpip安装zbarpyzbar效果很好。显然,这些文件存在,但无法通过Conda仓库获得。我在某处缺少回购吗?如果没有,是否有办法将使用pipbrew下载的软件包撬入Conda环境?

这是我尝试过的。

I see instructions其中说要使用conda install -c lightsource2-tag pyzbar。但是,Conda无法解决(此注释底部的完整错误消息)。

这似乎与搜索https://anaconda.org/search?q=pyzbar的结果一致。列出的唯一存储库仅适用于Linux和Win32。

(NewUI_conda) BlueMorph: /Users/Wes 12:16
516$ conda install -c lightsource2-tag pyzbar
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - pyzbar

Current channels:

  - https://conda.anaconda.org/lightsource2-tag/osx-64
  - https://conda.anaconda.org/lightsource2-tag/noarch
  - https://conda.anaconda.org/conda-forge/osx-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://repo.anaconda.com/pkgs/main/osx-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/osx-64
  - https://repo.anaconda.com/pkgs/r/noarch

python macos conda zbar
1个回答
0
投票

是的,看起来pyzbar无法通过Anaconda Cloud通道用于osx-64平台。相反,可以(谨慎地)混合使用PyPI和Conda软件包。例如,基本的YAML定义将类似于:

zbar_env.yaml

name: zbar_env
channels:
 - conda-forge
 - defaults
dependencies:
 - python=3
 - zbar
 - pip
 - pip:
   - pyzbar

可以实例化:

conda env create -f zbar_env.yaml

按照the recommendations for mixing PyPI and Conda,从一开始就将所有要求放在此YAML文件中。如果您需要添加新内容,请编辑YAML并重新创建环境。


或者,您可以切换到zbarlightwhich is available through Conda Forge,并且似乎保持不变。

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