【发布时间】:2019-03-20 04:30:56
【问题描述】:
我使用 brew 安装了 opencv-python numpy PyQt5。不幸的是,它仅在版本 2 中为 python 安装,但我希望它是版本 3。所以通常当我使用 python2 时,我可以导入这些库,但在 python3 中,只有找不到模块的错误。
当我输入例如 brew info numpy 时,我得到如下信息:
numpy: stable 1.15.2 (bottled), HEAD Package for scientific computing with Python https://www.numpy.org/ /usr/local/Cellar/numpy/1.15.2 (967 files, 25.5MB) Poured from bottle on 2018-10-15 at 12:13:26 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/numpy.rb
==> Dependencies Build: gcc ✔ Recommended: python ✔, python@2 ✔
==> Options
--without-python Build without python support
--without-python@2 Build without python2 support
--HEAD Install HEAD version
==> Analytics install: 33,262 (30d), 96,001 (90d), 314,869 (365d) install_on_request: 5,934 (30d), 19,037 (90d), 56,029 (365d) build_error: 0 (30d)
所以你可以看到“推荐”中只有 python2。有没有可能修复这个错误并以某种方式将这些库链接到 python3?
我正在使用 macOS High Sierra。
【问题讨论】:
标签: python python-3.x macos numpy opencv