gocv icon indicating copy to clipboard operation
gocv copied to clipboard

Compilation yields "/bin/sh: line 0: cd: OLDPWD not set" on MacOS

Open serge-hulne opened this issue 3 months ago • 2 comments

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.

serge-hulne avatar Mar 08 '24 15:03 serge-hulne

me too, i encounter the same problem with my m2 air

alan890104 avatar Mar 17 '24 14:03 alan890104

You should install OpenCV using Homebrew on macOS.

See https://gocv.io/getting-started/macos/

deadprogram avatar Mar 29 '24 07:03 deadprogram