[英]Python3 can't see opencv-python, numpy, PyQt5
我使用brew安裝了opencv-python numpy PyQt5。 不幸的是,它僅在版本2中為python安裝,但我希望它在ver 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。
為什么不使用pip3
為python3安裝軟件包? Brew用於安裝應用程序,而不是庫。
問題解決了。 最近,Python.org網站停止支持TLS版本1.0和1.1。 這有助於:
curl https://bootstrap.pypa.io/get-pip.py | python3
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.