Legoless / OpenCV-Dynamic

OpenCV iOS Dynamic Framework Podspec
http://opencv.org
Other
24 stars 13 forks source link

Cannot use a string pattern on a bytes-like object #5

Closed t1m0 closed 5 years ago

t1m0 commented 7 years ago

Hi,

I'm unable to install OpenCV-Dynamic with cocoapods. After playing around a while now I'm still not able to identify what I'm missing.

MacBook-Pro:project user$ xcodebuild -version
Xcode 8.2.1
Build version 8C1002

MacBook-Pro:hazmat user$ gem list --local cocoapods

*** LOCAL GEMS ***

cocoapods (1.2.0, 1.1.1)
cocoapods-core (1.2.0, 1.1.1, 0.39.0, 0.37.2)
cocoapods-deintegrate (1.0.1)
cocoapods-downloader (1.1.3, 0.9.3, 0.9.1)
cocoapods-plugins (1.0.0, 0.4.2)
cocoapods-search (1.0.0, 0.1.0)
cocoapods-stats (1.0.0, 0.6.2)
cocoapods-trunk (1.1.2, 0.6.4, 0.6.1)
cocoapods-try (1.1.0, 0.5.1, 0.4.5)

MacBook-Pro:project user$ pod install
Analyzing dependencies
Removing OpenCV2
Downloading dependencies
Using GPUImage (0.1.7)
Installing OpenCV-Dynamic (3.2.4)
[!] /bin/bash -c 
set -e
git submodule init
git submodule update
python opencv/platforms/ios/build_framework.py ios --dynamic
cp -a ./ios/opencv2.framework ./opencv2.framework

Submodule path 'opencv': checked out 'a8aff6f64330a0ab2c9d71033412af892dd9b710'
Submodule 'opencv' (https://github.com/opencv/opencv.git) registered for path 'opencv'
Cloning into '/Users/timo/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv'...
============================================================
ERROR: cannot use a string pattern on a bytes-like object
============================================================
Traceback (most recent call last):
  File "opencv/platforms/ios/build_framework.py", line 112, in build
    self._build(outdir)
  File "opencv/platforms/ios/build_framework.py", line 80, in _build
    xcode_ver = getXCodeMajor()
  File "opencv/platforms/ios/build_framework.py", line 42, in getXCodeMajor
    m = re.match(r'XCode\s+(\d)\..*', ret, flags=re.IGNORECASE)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/re.py", line 163, in match
    return _compile(pattern, flags).match(string)
TypeError: cannot use a string pattern on a bytes-like object
Legoless commented 7 years ago

Hm, look slike there is an incorrect value returned by getXCodeMajor function. Can you try xcode-select --install and report what is returned by xcode-select --version ?

solarisis commented 7 years ago

sudo softwareupdate -i Command Line Tools Password: Software Update Tool Copyright 2002-2015 Apple Inc.

Command: No such update Line: No such update Tools: No such update No updates are available. xcode-select --version xcode-select version 2345.1. am stuck at Submodule 'opencv' (https://github.com/opencv/opencv.git) registered for path 'opencv' Cloning into '/Users/*****/Library/Caches/CocoaPods/Pods/Release/OpenCV-Dynamic/3.2.4-8d4c9/opencv'...

doctorcolinsmith commented 6 years ago

The Podspec file should call /usr/bin/python instead of just python. The error above looks like it is calling python 3 instead of python 2. If Anaconda, or some other python, is installed, the python found in the path is not necessarily the right one.

Additionally, a check if cmake is installed would be nice. I got tripped up on that for a bit.

Legoless commented 6 years ago

Both very good points, will add it once I find some time.

Legoless commented 5 years ago

From 4.0.0-alpha1, /usr/bin/python is called instead of python.