Opencv-python: Add support for Python 3.7

Created on 28 Jun 2018  路  16Comments  路  Source: opencv/opencv-python

Hi there, we've noticed trying to upgrade our Python version to 3.7 that there is no way to install opencv-python with it. Would you consider adding it to the build matrice? Would you like a PR for that?

Thanks for the great work 馃憣

Most helpful comment

@yonip Thanks, I'll add support for 3.7 during this week, probably tomorrow.

@rose-maria As suggested above, open a new issue if you think that the error is related to this repository (note: building this package locally has not been tested but it might work on Windows).

All 16 comments

Yes, I will definetely add support for 3.7. However, there are a few things which need to be checked or updated before it is possible:

I can make the changes but the timetable for a new opencv-python release depends mostly on the issues listed above (if there are no other unexpected issues).

Just a few notes:

Thanks. Numpy's 3.7 wheels were released a bit after I wrote that message. Travis doesn't need to support 3.7 on Linux, the builds run in manylinux Docker containers which will have support for 3.7 after I rebuild them. macOS is ok if multibuild README says so.

I'll make the required changes after Appeyor has added Python 3.7.

On running : python setup.py install

I get :

Usage:
  H:\PYTHON\python.exe -m pip list [options]

no such option: --format
Traceback (most recent call last):
  File "setup.py", line 370, in <module>
    main()
  File "setup.py", line 25, in main
    numpy_version = get_or_install("numpy", "1.11.3" if sys.version_info[:2] >=
(3, 6) else "1.11.1")
  File "setup.py", line 352, in get_or_install
    subprocess.check_output([sys.executable, "-m", "pip", "list", "--format", "j
son"]).decode('ascii'))  # valid names & versions are ASCII as per PEP 440
  File "H:\PYTHON\lib\subprocess.py", line 618, in check_output
    raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '['H:\\PYTHON\\python.exe', '-m', 'pip',
'list', '--format', 'json']' returned non-zero exit status 2

Update/bump: Appveyor now includes Python 3.7.0

@rose-maria I don't think this is the place for your own bug report (you might want to make a separate issue for that), but I could not reproduce that error.

Does python -m pip list --format json also not work?

@yonip Thanks, I'll add support for 3.7 during this week, probably tomorrow.

@rose-maria As suggested above, open a new issue if you think that the error is related to this repository (note: building this package locally has not been tested but it might work on Windows).

Windows and Linux builds work fine but there's compiler compatibility issue on macOS due to upgrade to OpenCV 3.4.2:

/Users/travis/build/[secure]/opencv-python/opencv/3rdparty/protobuf/src/google/protobuf/arena_impl.h:182:10: error: thread-local storage is not supported for the current target

  static GOOGLE_THREAD_LOCAL ThreadCache thread_cache_;

Based on googling (https://stackoverflow.com/a/29929949/5795428) Xcode 8 should have support for thread-local storage but unfortunately the error persists with Xcode 8 and Xcode 9 environments in Travis. This is something which needs to be solved before I can make a new release.

Thanks for your continued excellent work on this. For those wanting to see the Xcode errors, here are the opencv-python Travis-CI build logs

@skvark
Any plan for python 3.7 support ? Thanks.

Good news: after multiple failed builds with different parameters and with awesome help from @yonip the macOS builds are now working. After the current builds are done, I'll release a new version. It will be available on PyPI at the latest on monday.

Release builds are now running and new packages will be available during the next 24 hours.

I am having some issues fetching the latest version when using Python3.7 - No matching distribution found for opencv-python.

I can reproduce it with the following Dockerfile:

FROM ubuntu:18.04

ENV DEBIAN_FRONTEND noninteractive

RUN apt update && \
    apt install -y python3.7 python3-pip
# set python3.7 as default for pip3
RUN ln -s -f /usr/bin/python3.7 /usr/bin/python3
RUN pip3 install opencv-python

Looking at the wheel files, it seems that the x86_64 wheel for py37 is missing.

Looks like I have made some mistakes in the build matrix... only i686 entries are there for Linux :/ I'll have to make a new release. It will take couple of days because I'm simply running out of hours.

It would help if someone could add the entries to the build matrix and submit a PR. I'll then make the release.

Hey, are the x86_64 PyPI wheels going to be up soon?
Just making sure they aren't forgotten 馃槂

Just tagged a new version, they will be slowly appearing to PyPI. Thanks for the patience.

The Linux x86_64 wheels for Python 3.7 are now on PyPi
https://pypi.org/project/opencv-python/#files

Was this page helpful?
0 / 5 - 0 ratings

Related issues

acodercat picture acodercat  路  5Comments

yushengsu picture yushengsu  路  6Comments

Borda picture Borda  路  4Comments

chtsngn picture chtsngn  路  3Comments

moneer88 picture moneer88  路  6Comments