Zbar + python,导入时崩溃 (OSX 10.9.1) [英] Zbar + python, crashes on import (OSX 10.9.1)

查看:45
本文介绍了Zbar + python,导入时崩溃 (OSX 10.9.1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试安装 Zbar 以与带有 Homebrew 和 pip(brew install zbar,然后 pip install zbar)的 python 2.7.6 一起使用,但是每次我导入它时,python 都会崩溃.简单地运行:

I've attempted to install Zbar for use with python 2.7.6 with Homebrew and pip (brew install zbar, then pip install zbar) but every time I import it, python crashes. Simply running:

#!/usr/bin/python

import zbar

从终端用这个给我着陆:

lands me with this from the terminal:

:~ aj$ cd '/Users/aj/Documents/nlcc/check in/python/' && '/usr/bin/python'
'/Users/aj/Documents/nlcc/check in/python/test.py' 
&& echo Exit status: $? && exit 1
Segmentation fault: 11

其他模块(wxPython、Numpy、openCV)工作得很好,但这个模块每次都给我同样的崩溃.我试过从源代码编译和安装 zbar,认为这可能是 Homebrew(或者甚至 pip)的问题,但是它有自己的一系列问题,老实说我无法理解(即运行后缺少 dylib./配置选项,然后是开发人员的 setup.py).有人有主意吗?抱歉,如果我遗漏了任何相关信息,如果有人想要任何其他日志,请告诉我如何检索它们,我会尽快发布它们,就像我说的那样,其中很多已经结束了头.

Other modules (wxPython, Numpy, openCV) work just fine, but this one gives me the same crash every time. I've tried compiling and installing zbar from source, thinking it might be an issue with Homebrew (or maybe even pip), but that has its own set of issues that are quite honestly over my head (i.e. missing a dylib after running ./configure with options, and then the developer's setup.py). Anyone have any ideas? Sorry if I'm missing any relevant info, if anyone would like any other logs, just let me know how to retrieve them, and I'll post them as soon as I can, like I said, a lot of this is over my head.

推荐答案

我找到了答案,但我还是想把它贴在这里,以防有人遇到和我一样的麻烦.您可以使用 zbar 的 brew 安装,但您必须通过以下方式安装到 python:pypi.python.org/pypi/zbar 使用此补丁:https://github.com/npinchot/zbar/commit/d3c1611ad2411fbdc3e79eb96ca704a63d30a69另外,请务必在终端中使用 which python 以确保它在正确的目录中检查.我发现做到这一点的唯一可靠方法是 edit ~/.bashrc 并添加 /usr/local//usr/local/bin/ 目录,然后 source ~/.bashrc 每当我打开终端以通过 pip 或 Homebrew 安装任何东西时.

I found the answer, but I wanted to post it here anyway in case anyone has the same trouble I did. You can use the brew installation of zbar, but you have to install to python via: pypi.python.org/pypi/zbar using this patch: https://github.com/npinchot/zbar/commit/d3c1611ad2411fbdc3e79eb96ca704a63d30ae69. Also, be sure to use which python in the terminal to make sure it's checking in the right directory. The only reliable way I found to make it do this was to edit ~/.bashrc and add the /usr/local/ and /usr/local/bin/ directories to it, and then source ~/.bashrc whenever I opened a terminal to install anything via pip or Homebrew.

感谢关于回答和接受@lkraider 的提示

Thanks for the tip about answering and accepting @lkraider

这篇关于Zbar + python,导入时崩溃 (OSX 10.9.1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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