如何在GCP中導入OpenCV?我在這裏使用Google Datalab。在Google Cloud Datalab中導入OpenCV
它看起來像我可以安裝該軟件包:
!pip install opencv-python
Collecting opencv-python
Downloading opencv_python-3.2.0.7-cp27-cp27mu-manylinux1_x86_64.whl (6.7MB)
100% |################################| 6.7MB 98kB/s
Requirement already satisfied: numpy>=1.11.1 in
/usr/local/lib/python2.7/dist-packages (from opencv-python)
Installing collected packages: opencv-python
Successfully installed opencv-python-3.2.0.7
但我導入CV2後,我得到一個錯誤
import cv2
ImportErrorTraceback (most recent call last)
<ipython-input-17-72fbbcfe2587> in <module>()
----> 1 import cv2
/usr/local/lib/python2.7/dist-packages/cv2/__init__.py in <module>()
5 os.environ["PATH"] += os.pathsep + os.path.dirname(os.path.realpath(__file__))
6
----> 7 from . import cv2
8 sys.modules['cv2'] = cv2
ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
並沒有爲我工作:「E:有未經認證的軟件包,並且-y的使用沒有--allow-unauthenticated「 – Bastiaan