python cannot import opencv because it can't find libjpeg.8.dylib

前端 未结 4 1273
Happy的楠姐
Happy的楠姐 2020-12-10 14:52

Trying to get opencv for python working on Mac OSX - Mavericks but keep getting an image not found for libjpeg.8.dylib when doing import cv from python

(Recently upd

4条回答
  •  情歌与酒
    2020-12-10 15:19

    I had a similar problem with the Pillow library on macOS. The solution proposed here to install it from source worked for me. I had to install it to /usr/local/ for Pillow to find it. You'll need command-line tools, which is the purpose of the first line:

    xcode-select --install
    curl -O -J -L http://www.ijg.org/files/jpegsrc.v8.tar.gz
    tar xvfz jpeg*tar.gz                 # Unzip and untar what you downloaded
    cd jpeg-8                            # Change directory to wherever it unpacked to
    ./configure --prefix="/usr/local"    # Configure with the necessary prefix
    make
    sudo make install
    

提交回复
热议问题