What to do if a symbolic link error occurs in import cv while trying to install OpenCV in Python

error contents

$ python
Python 2.7.6 (default, Apr  9 2014, 11:48:52)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/cv.py", line 1, in <module>
    from cv2.cv import *
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/cv2.so, 2): Library not loaded: /usr/local/lib/libjpeg.8.dylib
  Referenced from: /usr/local/Cellar/opencv/2.4.9/lib/libopencv_highgui.2.4.dylib
  Reason: image not found

Library not loaded: /usr/local/lib/libjpeg.8.dylib

It seems that /usr/local/lib/libjpeg.8.dylib is not loaded.

Find the location of libjpeg.8.dylib

$ find / -name libjpeg.8.dylib

Re-paste the symbolic link. ln -s /usr/local/Cellar/jpeg/8d/lib/libjpeg.8.dylib /usr/local/lib/

When I searched for the same OpenCV introductory article, some people got a symbolic link error and others didn't. I happened.

success!!

Python 2.7.6 (default, Apr  9 2014, 11:48:52)
[GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv
>>>

Reference link

Recommended Posts

What to do if a symbolic link error occurs in import cv while trying to install OpenCV in Python
What to do if a Unicode Encode Error occurs in Sublime Text Python
What to do if you install openCV3 and make a symbolic link, but when you do "import cv2", "No module named'cv2'" appears
What to do if a 0xC0000005 error occurs in tf.train.start_queue_runners ()
What to do if a UnicodeDecodeError occurs in pip
[Python] What to do if an error occurs in pip (pyinstaller, pyautogui, etc.)
What to do if a version error occurs in the selenium Chrome driver
What to do if you get a minus zero in Python
What to do if you get Swagger-codegen in python and Import Error: No module named
What to do if you get a must override `get_config` error when trying to model.save in Keras
What to do if there is a decimal in python json .dumps
What happens if you do "import A, B as C" in Python?
Error when trying to install psycopg2 in Python
What to do if an error occurs in TensorFlow RNN related import or RNN (LSTM) Cell (v 0.11r ~)
What to do if you get a "No versions found" error in pipenv
[python] What to do when an error occurs in send_keys of headless chrome
What to do if pip install fails in Xcode 5.1
What to do if you get an error when trying to send a message in tasks.loop () immediately after startup
What to do if the print command itself causes an error in Maya python
What to do if you get an error when importing matplotlib in Python (Mac)
What to do if you run python in IntelliJ and end with an error
What to do if you get the error RuntimeError: Python is not installed as a framework when trying to use matplitlib and pylab in Python 3.3
What to do if ʻarguments [0] .scrollIntoView ();` fails in python selenium
What to do if pip gives a DistributionError in Homebrew
What to do when a Remove Error occurs when updating conda
What to do when an error occurs with import _ssl
What to do if Fatal Python error: Py_Initialize: can't initialize sys standard streams LookupError: unknown encoding: windows-31j occurs in PyCharm
What to do if you can't install pyaudio with pip #Python
[Beanstalk] What to do when an error occurs with import uuid
What to do when ModuleNotFoundError: No module named'XXX' occurs in Python
What to do if pip --user returns an error in a virtual environment created with pyenv
What to do if you can't use scikit grid search in Python
What to do if pyenv install does not proceed with an error
What to do if No Python documentation found for ... appears in pydoc
What to do if an error occurs when importing numpy with VScode
What to do if you get an error when trying to load mnist
What to do if you can't install with pip in babun environment
[OSX] [pyenv] What to do when an SSL error occurs in pip
What to do if you get angry with "Value Error: unknown local: UTF-8" in python manage.py syncdb
What to do if you get a Permission denied (public key) error when trying to pull on Github
[Python] What to do if you get a ModuleNotFoundError when importing pandas using Jupyter Notebook in Anaconda
What to do if pipreqs results in UnicodeDecodeError
Note: What to do if pip install fails
What to do when SSL error occurs in pip in Windows10, miniconda, VScode environment
What to do if you get an error when installing python with pyenv
What to do if you are told "Import Error: cannot import name'HTTPSHandler'" when building a virtual environment using virtualenv
What to do if you get "Python not configured." Using PyDev in Eclipse
[Python] What to check when you get a Unicode Decode Error in Django
What to do if abort is displayed when inputting camera video in OpenCV
What to do if NotADirectoryError: [Errno 20] Not a directory:'xdg-settings' appears in jupyter notebook
What to do to get google spreadsheet in python
What to do if an SSL connection error (ssl.SSLError: [SSL: DH_KEY_TOO_SMALL]) occurs on Ubuntu 20.04
What to do if you get a Call with too many input arguments error at DoAndReturn in a golang test
What to do if a communication error occurs due to proxy when installing with package management of pip, npm, gem
What to do if you get the error "Error: opencv3: Does not support building both Python 2 and 3 wrappers" when installing openCV 3
[Python] Type Error:'WebElement' object is not iterable What to do when an error occurs
What to do if "export" keeps appearing on terminal when trying to put Python on macOS
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if you get "(35,'SSL connect error')" in pycurl (one of them)
What to do if the progress bar is not displayed in tqdm of python
What to do if Python IntelliSense is not displayed in VS Code on Windows