gocv
gocv copied to clipboard
Compilation yields "/bin/sh: line 0: cd: OLDPWD not set" on MacOS
Description
make install
rm -rf /tmp/opencv
mkdir /tmp/opencv
cd /tmp/opencv
curl -Lo opencv.zip https://github.com/opencv/opencv/archive/refs/tags/4.8.1.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 92.1M 0 92.1M 0 0 726k 0 --:--:-- 0:02:09 --:--:-- 836k
unzip -q opencv.zip
replace opencv-4.8.1/.editorconfig? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
curl -Lo opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/refs/tags/4.8.1.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 58.6M 0 58.6M 0 0 582k 0 --:--:-- 0:01:43 --:--:-- 748k
unzip -q opencv_contrib.zip
replace opencv_contrib-4.8.1/.editorconfig? [y]es, [n]o, [A]ll, [N]one, [r]ename: A
rm opencv.zip opencv_contrib.zip
cd -
/bin/sh: line 0: cd: OLDPWD not set
Environment
MacOS : 14.3.1 (23D60) Apple silicon M1 brew install opencv /opt/homebrew/Cellar/opencv/4.9.0_4 go version go1.21.3 darwin/arm64
sh env.sh
This script is no longer necessary and has been deprecated.
See the Custom Environment section of the README if you need to customize your environment.
me too, i encounter the same problem with my m2 air
You should install OpenCV using Homebrew on macOS.
See https://gocv.io/getting-started/macos/