Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I've tried to install cv2 into deepnote and also into Pycharm using the following code - but nothing seems to work? Is cv2 not installable anymore? I've been using it up till last week and it was working fine but it doesn't seem to work anymore.

!pip install opencv-python
!pip install --upgrade pip

import cv2 # openCV for computer vision
import numpy as np # numpy for arrays
import pandas as pd
from matplotlib import pyplot as plt # matplotlib for plotting

Anyone have any idea what has happened? I've not changed any code whatsoever. Thanks

question from:https://stackoverflow.com/questions/65884587/opencv-not-installing

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
1.1k views
Welcome To Ask or Share your Answers For Others

1 Answer

The linked code is correct. In some environments (like Deepnote), however, you have to install extra dependencies as suggested in this answer.

!apt update
!apt install ffmpeg libsm6 libxext6  -y

Here's an example notebook of this working properly. Specifically in Deepnote, you can move the apt and pip install calls into a Custom environments Dockerfile.

In the future, please be more specific about what is not working.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...