gpt4 book ai didi

python - 为什么 Homebrew 不在 OS X 10.8 上创建 python 绑定(bind)文件?

转载 作者:太空狗 更新时间:2023-10-30 01:34:49 24 4
gpt4 key购买 nike

我正在尝试在装有 Mountain Lion 的 Mac 上将 OpenCV 与 PySide 结合使用。 Homebrew 公式工作正常,但 python 绑定(bind)文件未显示。

romaindeterre$ brew install opencv
==> Downloading http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.3/Op
Already downloaded: /Library/Caches/Homebrew/opencv-2.4.3.tar.bz2
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.3 -DCMAKE_BUILD_TYPE=None
==> make
==> make install
==> Caveats
The OpenCV Python module will not work until you edit your PYTHONPATH like so:
export PYTHONPATH="/usr/local/lib/python2.7/site-packages:$PYTHONPATH"

To make this permanent, put it in your shell's profile (e.g. ~/.profile).
==> Summary
/usr/local/Cellar/opencv/2.4.3: 214 files, 51M, built in 108 seconds

/usr/local/lib/python2.7/site-packages 不包含任何名为 cv.* 的文件。

我执行了 brew update 并且 brew doctor 的输出如下:

Warning: "config" scripts exist outside your system or Homebrew directories. ./configure scripts often look for *-config scripts to determine if software packages are installed, and what additional flags to use when compiling and linking.

Having additional scripts in your path can confuse software installed via Homebrew if the config script overrides a system or Homebrew provided script of the same name. We found the following "config" scripts:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config

我是否缺少正确安装 OpenCV 的任何内容?

谢谢

最佳答案

我真的会推荐使用 pip 和 virtualenv 进行 python 开发。在 Mac 上,这个 hitchhikers 指南是关于如何设置它的好读物。使用 virtualenv 将创建一个独立的 python 路径,使用 pip 在虚拟环境中安装东西将在这方面真正有帮助。

https://python-guide.readthedocs.org/en/latest/starting/install/osx/

关于python - 为什么 Homebrew 不在 OS X 10.8 上创建 python 绑定(bind)文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13593995/

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