PaulleDemon / tkVideoPlayer

Video player for tkinter.
MIT License
79 stars 25 forks source link

Error on install #46

Closed jasonbrickman2022 closed 8 months ago

jasonbrickman2022 commented 8 months ago

I am installing to a virtual enviroment on mac os sonoma 14.0. My pip cant build the wheel. Here is the error message

(.venv) jason@Mac-Studio MoveMind-1 % pip in stall tkvideoplayer Collecting tkvideoplayer Using cached tkvideoplayer-2.5-py3-none-any.whl.metadata (3.2 kB) Collecting av==9.1.1 (from tkvideoplayer) Using cached av-9.1.1.tar.gz (2.4 MB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [80 lines of output] Compiling av/plane.pyx because it changed. [1/1] Cythonizing av/plane.pyx Compiling av/dictionary.pyx because it changed. [1/1] Cythonizing av/dictionary.pyx Compiling av/stream.pyx because it changed. [1/1] Cythonizing av/stream.pyx Compiling av/option.pyx because it changed. [1/1] Cythonizing av/option.pyx Compiling av/enum.pyx because it changed. [1/1] Cythonizing av/enum.pyx Compiling av/bytesource.pyx because it changed. [1/1] Cythonizing av/bytesource.pyx Compiling av/buffer.pyx because it changed. [1/1] Cythonizing av/buffer.pyx Compiling av/packet.pyx because it changed. [1/1] Cythonizing av/packet.pyx Compiling av/error.pyx because it changed. [1/1] Cythonizing av/error.pyx Compiling av/_core.pyx because it changed. [1/1] Cythonizing av/_core.pyx Compiling av/format.pyx because it changed. [1/1] Cythonizing av/format.pyx performance hint: av/logging.pyx:232:5: Exception check on 'log_callback' will always require the GIL to be acquired. Possible solutions:

  1. Declare 'log_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
  2. Use an 'int' return type on 'log_callback' to allow an error code to be returned.

    Error compiling Cython file:

    ... cdef const char log_context_name(void ptr) nogil: cdef log_context obj = <log_context>ptr return obj.name

    cdef lib.AVClass log_class log_class.item_name = log_context_name ^

    av/logging.pyx:216:22: Cannot assign type 'const char (void ) except? NULL nogil' to 'const char ()(void ) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'const char (void *) except? NULL nogil'.

    Error compiling Cython file:

    ...

    Start the magic!

    We allow the user to fully disable the logging system as it will not play

    nicely with subinterpreters due to FFmpeg-created threads.

    if os.environ.get('PYAV_LOGGING') != 'off': lib.av_log_set_callback(log_callback) ^

    av/logging.pyx:351:28: Cannot assign type 'void (void , int, const char , va_list) except nogil' to 'av_log_callback'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void , int, const char , va_list) except nogil'. Compiling av/logging.pyx because it changed. [1/1] Cythonizing av/logging.pyx Traceback (most recent call last): File "/Users/jason/Documents/Coding Things/MoveMind-1/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in main() File "/Users/jason/Documents/Coding Things/MoveMind-1/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(*hook_input['kwargs']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/jason/Documents/Coding Things/MoveMind-1/.venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) ^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/66/s0kscts11cz1l8d_yd8721ww0000gn/T/pip-build-env-yyfayn9z/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/private/var/folders/66/s0kscts11cz1l8d_yd8721ww0000gn/T/pip-build-env-yyfayn9z/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires self.run_setup() File "/private/var/folders/66/s0kscts11cz1l8d_yd8721ww0000gn/T/pip-build-env-yyfayn9z/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 480, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "/private/var/folders/66/s0kscts11cz1l8d_yd8721ww0000gn/T/pip-build-env-yyfayn9z/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 156, in File "/private/var/folders/66/s0kscts11cz1l8d_yd8721ww0000gn/T/pip-build-env-yyfayn9z/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1154, in cythonize cythonize_one(args) File "/private/var/folders/66/s0kscts11cz1l8d_yd8721ww0000gn/T/pip-build-env-yyfayn9z/overlay/lib/python3.11/site-packages/Cython/Build/Dependencies.py", line 1321, in cythonize_one raise CompileError(None, pyx_file) Cython.Compiler.Errors.CompileError: av/logging.pyx [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

sunny9495-dev commented 8 months ago

I am getting the same issue.

PaulleDemon commented 8 months ago

can you try installing 2.3 version and let me know if you are facing the same problem? https://pypi.org/project/tkvideoplayer/2.3/ @sunny9495-dev @jasonbrickman2022

sunny9495-dev commented 8 months ago

@PaulleDemon 2.3 version worked.

PaulleDemon commented 8 months ago

@sunny9495-dev thanks for letting me know. I'll see what's wrong with the current build and update whenever I get time.

PaulleDemon commented 8 months ago

@sunny9495-dev I just updated the package. Can you try pip install tkvideoplayer==2.8 and let me know if it works?

sunny9495-dev commented 8 months ago

@PaulleDemon Installation isn't successful, Here is the log

Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [74 lines of output]
      Compiling av\buffer.pyx because it changed.
      [1/1] Cythonizing av\buffer.pyx
      Compiling av\bytesource.pyx because it changed.
      [1/1] Cythonizing av\bytesource.pyx
      Compiling av\descriptor.pyx because it changed.
      [1/1] Cythonizing av\descriptor.pyx
      Compiling av\dictionary.pyx because it changed.
      [1/1] Cythonizing av\dictionary.pyx
      Compiling av\enum.pyx because it changed.
      [1/1] Cythonizing av\enum.pyx
      Compiling av\error.pyx because it changed.
      [1/1] Cythonizing av\error.pyx
      Compiling av\format.pyx because it changed.
      [1/1] Cythonizing av\format.pyx
      Compiling av\frame.pyx because it changed.
      [1/1] Cythonizing av\frame.pyx
      performance hint: av\logging.pyx:232:5: Exception check on 'log_callback' will always require the GIL to be acquired.
      Possible solutions:
          1. Declare 'log_callback' as 'noexcept' if you control the definition and you're sure you don't want the function to raise exceptions.
          2. Use an 'int' return type on 'log_callback' to allow an error code to be returned.

      Error compiling Cython file:
      ------------------------------------------------------------
      ...
      cdef const char *log_context_name(void *ptr) nogil:
          cdef log_context *obj = <log_context*>ptr
          return obj.name

      cdef lib.AVClass log_class
      log_class.item_name = log_context_name
                            ^
      ------------------------------------------------------------

      av\logging.pyx:216:22: Cannot assign type 'const char *(void *) except? NULL nogil' to 'const char *(*)(void *) noexcept nogil'. Exception values are incompatible. Suggest adding 'noexcept' to type 'const char *(void *) except? NULL nogil'.

      Error compiling Cython file:
      ------------------------------------------------------------
      ...

      # Start the magic!
      # We allow the user to fully disable the logging system as it will not play
      # nicely with subinterpreters due to FFmpeg-created threads.
      if os.environ.get('PYAV_LOGGING') != 'off':
          lib.av_log_set_callback(log_callback)
                                  ^
      ------------------------------------------------------------

      av\logging.pyx:351:28: Cannot assign type 'void (void *, int, const char *, va_list) except * nogil' to 'av_log_callback'. Exception values are incompatible. Suggest adding 'noexcept' to type 'void (void *, int, const char *, va_list) except * nogil'.
      Compiling av\logging.pyx because it changed.
      [1/1] Cythonizing av\logging.pyx
      Traceback (most recent call last):
        File "C:\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Python\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\sunny9495\AppData\Local\Temp\pip-build-env-0oe_kig6\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\sunny9495\AppData\Local\Temp\pip-build-env-0oe_kig6\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "C:\Users\sunny9495\AppData\Local\Temp\pip-build-env-0oe_kig6\overlay\Lib\site-packages\setuptools\build_meta.py", line 480, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "C:\Users\sunny9495\AppData\Local\Temp\pip-build-env-0oe_kig6\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 157, in <module>
        File "C:\Users\sunny9495\AppData\Local\Temp\pip-build-env-0oe_kig6\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1154, in cythonize
          cythonize_one(*args)
        File "C:\Users\sunny9495\AppData\Local\Temp\pip-build-env-0oe_kig6\overlay\Lib\site-packages\Cython\Build\Dependencies.py", line 1321, in cythonize_one
          raise CompileError(None, pyx_file)
      Cython.Compiler.Errors.CompileError: av\logging.pyx
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Using Python V3.11.4

PaulleDemon commented 8 months ago

Hmm @sunny9495-dev . I tried on Ubuntu and it seems to run correctly. Can you try to install the PyAv library separately pip install av==9.2.0? Also, try to upgrade Cython pip install --upgrade cython. Let me know if any of this helps. If nothing works, can you also go through this thread: https://github.com/PyAV-Org/PyAV/issues/1140

edpowell commented 8 months ago

I have the same problem with v2.8 on Mac running Sonoma 14.2.1 on Apple M2 Max with Python 3.11.3. But version 2.3 installs and works fine.

PaulleDemon commented 8 months ago

@edpowell thanks for letting me know. This apparently is a problem specific to python 3.11 and above. Currently PyAV 9.2.0 supports only till 3.10. The latest pyav 11 does support till python 12, however upon trying the latest package, I seem to notice a memory leak, so we'll have to set to 9.2.0.

I would suggest anyone coming across this problem to stick to 3.10 or lower for some more time.

PaulleDemon commented 8 months ago

https://github.com/PaulleDemon/tkVideoPlayer/issues/47