question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug]: video-decode could not be successful in python 3.6 for failure to install av

See original GitHub issue

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

>>> import towhee
>>>
>>>
>>> (
...     towhee.glob('/Users/binbin/Towhee_projects/archery.mp4')
...           .video_decode.ffmpeg()
...           .action_classification.actionclip(model_name='clip_vit_b16')
...           .show()
... )
Collecting av
  Using cached av-9.2.0.tar.gz (2.4 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: av
  Building wheel for av (pyproject.toml) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/binbin/towhee-test-env-3.6-0.7.3/bin/python3 /Users/binbin/towhee-test-env-3.6-0.7.3/lib/python3.6/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /var/folders/bs/z2281z812w13j5bmwc7jhhmm0000gn/T/tmpa5e41ttc
       cwd: /private/var/folders/bs/z2281z812w13j5bmwc7jhhmm0000gn/T/pip-install-s83cwphb/av_bf6b963e88d842d89b974bbf679ec5cb
  Complete output (122 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.6
  creating build/lib.macosx-10.9-x86_64-3.6/av
  copying av/deprecation.py -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/datasets.py -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/about.py -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/__main__.py -> build/lib.macosx-10.9-x86_64-3.6/av
  creating build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/video
  creating build/lib.macosx-10.9-x86_64-3.6/av/codec
  copying av/codec/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/codec
  creating build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/container
  creating build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  creating build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/subtitles/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  creating build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  creating build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  copying av/sidedata/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  creating build/lib.macosx-10.9-x86_64-3.6/av/data
  copying av/data/__init__.py -> build/lib.macosx-10.9-x86_64-3.6/av/data
  copying av/utils.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/frame.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/descriptor.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/logging.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/format.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/error.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/buffer.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/packet.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/bytesource.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/enum.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/option.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/dictionary.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/plane.pxd -> build/lib.macosx-10.9-x86_64-3.6/av
  copying av/video/frame.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/reformatter.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/format.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/codeccontext.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/video/plane.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/video
  copying av/codec/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/codec
  copying av/codec/context.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/codec
  copying av/codec/codec.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/codec
  copying av/container/input.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/core.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/pyio.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/output.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/container/streams.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/container
  copying av/audio/frame.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/fifo.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/format.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/layout.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/codeccontext.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/resampler.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/audio/plane.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/audio
  copying av/subtitles/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/subtitles/codeccontext.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/subtitles/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/subtitles/subtitle.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/subtitles
  copying av/filter/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/graph.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/context.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/filter.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/pad.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/filter/link.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/filter
  copying av/sidedata/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  copying av/sidedata/motionvectors.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  copying av/sidedata/sidedata.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/sidedata
  copying av/data/__init__.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/data
  copying av/data/stream.pxd -> build/lib.macosx-10.9-x86_64-3.6/av/data
  running build_ext
  building 'av.plane' extension
  creating build/temp.macosx-10.9-x86_64-3.6
  creating build/temp.macosx-10.9-x86_64-3.6/src
  creating build/temp.macosx-10.9-x86_64-3.6/src/av
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -I/usr/local/Cellar/ffmpeg/5.0.1_3/include -I/Users/binbin/towhee-test-env-3.6-0.7.3/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/av/plane.c -o build/temp.macosx-10.9-x86_64-3.6/src/av/plane.o
  gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/src/av/plane.o -L/usr/local/Cellar/ffmpeg/5.0.1_3/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.macosx-10.9-x86_64-3.6/av/plane.cpython-36m-darwin.so
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavformat.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavcodec.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavdevice.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavutil.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libswscale.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavfilter.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libswresample.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  building 'av.dictionary' extension
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -I/usr/local/Cellar/ffmpeg/5.0.1_3/include -I/Users/binbin/towhee-test-env-3.6-0.7.3/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/av/dictionary.c -o build/temp.macosx-10.9-x86_64-3.6/src/av/dictionary.o
  gcc -bundle -undefined dynamic_lookup -arch x86_64 -g build/temp.macosx-10.9-x86_64-3.6/src/av/dictionary.o -L/usr/local/Cellar/ffmpeg/5.0.1_3/lib -lavformat -lavcodec -lavdevice -lavutil -lavfilter -lswscale -lswresample -o build/lib.macosx-10.9-x86_64-3.6/av/dictionary.cpython-36m-darwin.so
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavformat.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavcodec.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavutil.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavdevice.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libavfilter.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libswresample.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  ld: warning: dylib (/usr/local/Cellar/ffmpeg/5.0.1_3/lib/libswscale.dylib) was built for newer macOS version (11.0) than being linked (10.9)
  building 'av.stream' extension
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -g -I/usr/local/Cellar/ffmpeg/5.0.1_3/include -I/Users/binbin/towhee-test-env-3.6-0.7.3/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c src/av/stream.c -o build/temp.macosx-10.9-x86_64-3.6/src/av/stream.o
  src/av/stream.c:2305:29: error: no member named 'codec' in 'struct AVStream'
    switch (__pyx_v_c_stream->codec->codec_type) {
            ~~~~~~~~~~~~~~~~  ^
  src/av/stream.c:2923:31: error: no member named 'codec' in 'struct AVStream'
    __pyx_t_1 = __pyx_v_stream->codec;
                ~~~~~~~~~~~~~~  ^
  src/av/stream.c:3043:15: warning: assigning to 'struct AVCodec *' from 'const struct AVCodec *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
      __pyx_t_6 = __pyx_v_self->_codec_context->codec;
                ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  src/av/stream.c:3828:132: error: no member named 'codec' in 'struct AVStream'
    __pyx_t_7 = __pyx_f_2av_5error_err_check(avcodec_parameters_from_context(__pyx_v_self->_stream->codecpar, __pyx_v_self->_stream->codec), 0, NULL); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 150, __pyx_L1_error)
                                                                                                              ~~~~~~~~~~~~~~~~~~~~~  ^
  1 warning and 3 errors generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for av
Failed to build av
ERROR: Could not build wheels for av, which is required to install pyproject.toml-based projects

Expected Behavior

No error

Steps To Reproduce

Running the following code in python3.6 env:

import towhee

(
    towhee.glob('./archery.mp4') 
          .video_decode.ffmpeg()
          .action_classification.actionclip(model_name='clip_vit_b16')
          .show()
)

Environment

- Towhee version(e.g. v0.1.3 or 8b23a93): towhee 0.7.3 candidate
- OS(Ubuntu or CentOS):
- CPU/Memory:
- GPU:
- Others:

Anything else?

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
filip-haltcommented, Jul 25, 2022

@filip-halt so this issue should be left as known issue until the fix of PyAV-Org/PyAV#817?

@junjiejiangjjj

I believe so, but I think @junjiejiangjjj is the better person to ask.

0reactions
stale[bot]commented, Sep 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Rotten issues close after 30d of inactivity. Close the stale issues and pull requests after 7 days of inactivity. Reopen the issue with /reopen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

PyAV does not build with ffmpeg 5.x · Issue #817 - GitHub
pip install av --no-binary av works with the latest FFmpeg version ... [Bug]: video-decode could not be successful in python 3.6 for failure...
Read more >
Python installation fails when run under system account if ...
This issue seems to affect all Python 3 Windows installers. ... successful installation that does not really install all the Python ...
Read more >
Installing pip is not working in python < 3.6 - Stack Overflow
python -m pip install --upgrade "pip < 21.0" . It seems reinstall my pip 20.3.4 and the error disappreared! Share.
Read more >
Not Able to Build Some Versions of Python on M1 at 12.3.1
In older OS these versions would build fine. Following is the failure I get running pyenv install 3.6.9 python-build: use openssl@1.1 from homebrew ......
Read more >
Python SDK install failed with PEP 517 - Couchbase Forums
ERROR : Could not build wheels for couchbase which use PEP 517 and cannot be ... pip install couchbase -v -v -v >...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found