在Mac OS X上使用Conda安装pyzbar时出错 [英] Error installing pyzbar with Conda on Mac OS X

查看:142
本文介绍了在Mac OS X上使用Conda安装pyzbar时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am attempting to convert a project from a Python 3 venv to Conda. However, it doesn't work with Conda, apparently because there is no repository that supports macOS.

这令人失望,因为在原始项目中使用 brew pip 安装 zbar pyzbar 可以正常工作.显然,这些文件存在,但无法通过Conda存储库获得.我在某处缺少回购吗?如果没有,是否有办法将通过 pip brew 下载的软件包撬入Conda环境?

This is disappointing because using brew and pip to install zbar and pyzbar in the original project works fine. So clearly the files exist but are not available through Conda repos. Am I missing a repo somewhere? If not, is there a way to crowbar the packages downloaded with pip and brew into a Conda environment?

这就是我尝试过的.

参见说明,其中说要使用 conda install -c lightsource2-tagpyzbar .但是,Conda无法解决(此注释底部的完整错误消息).

I see instructions which say to use conda install -c lightsource2-tag pyzbar. However Conda fails to resolve (complete error message at the bottom of this note).

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

This seems consistent with the results of searching https://anaconda.org/search?q=pyzbar . The only repos listed are for Linux and 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

推荐答案

是的,看来 pyzbar 无法通过 osx-64 平台的Anaconda Cloud渠道使用.取而代之的是,可以(谨慎地)混合使用PyPI和Conda软件包.例如,基本的YAML定义应类似于:

Yes, it looks like pyzbar is not available through Anaconda Cloud channels for osx-64 platform. Instead, one can (cautiously) mix PyPI and Conda packages. For example, a basic YAML definition would be something like:

zbar_env.yaml

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

可以用以下方法实例化:

which can be instantiated with:

conda env create -f zbar_env.yaml

按照

As per the recommendations for mixing PyPI and Conda, place all requirements in this YAML file from the start. If you need to add something new, edit the YAML and recreate the env.

或者,您可以切换到 zbarlight 可通过Conda Forge获得,并且似乎保持不变.

Alternatively, you could switch to zbarlight, which is available through Conda Forge and appears to be consistently maintained.

这篇关于在Mac OS X上使用Conda安装pyzbar时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆