Fenghe's Blog

Quickly Setup an OpenCV Project on macOS with PyCharm

Firstly, go to the top bar and select PyCharm, then select Preferences.

In the new window, select Project Interpreter, and then click on the “+” sign at the left-bottom corner of the window to add a python package to the venv(virtual environment).

Then search opencv-python, and the first in the list is the package you need. You can now click on the “Install Package” button to install the package.

After the installation, you are now safe to import cv2 on your macOS.

Additional Resources

You may also need matplotlib package to plot the images or videos, following is the command to install the package inside the venv.

$ python -m pip install -U matplotlib

References

  1. https://matplotlib.org/users/installing.html

Leave a Reply

Your email address will not be published. Required fields are marked *