Skip to content

Cannot install under Ubuntu 24.04 #2

@daald

Description

@daald

The last version 0.1.2 as described in https://pypi.org/project/pHashPy/ doesn't install anymore under Ubuntu 24.04 with python 3.12.3. Last time it worked for me was with 22.04. (I don't know about the ubuntu versions between).

It seems that one library the binary code depends on had major changes and is not incompatible. Updating to the latest version of pHash didn't work.

Currently installed on my system:

ii libavcodec-dev:amd64 7:6.1.1-3ubuntu5 amd64 FFmpeg library with de/encoders for audio/video codecs - development files
ii libavcodec60:amd64 7:6.1.1-3ubuntu5 amd64 FFmpeg library with de/encoders for audio/video codecs - runtime files

Before, the version was probably 7:4.4.2-0ubuntu0.22.04.1

Using cached cppyy_cling-6.32.8-py2.py3-none-manylinux2014_x86_64.whl (47.8 MB) Building wheels for collected packages: pHashPy
  Building wheel for pHashPy (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pHashPy (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [235 lines of output]
      /tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-312/pHashPy
      copying pHashPy/__init__.py -> build/lib.linux-x86_64-cpython-312/pHashPy
      copying pHashPy/__main__.py -> build/lib.linux-x86_64-cpython-312/pHashPy
      copying pHashPy/helpers.py -> build/lib.linux-x86_64-cpython-312/pHashPy
      copying pHashPy/image.py -> build/lib.linux-x86_64-cpython-312/pHashPy
      copying pHashPy/video.py -> build/lib.linux-x86_64-cpython-312/pHashPy
      running build_ext
      CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
        Compatibility with CMake < 3.5 will be removed from a future version of
        CMake.

        Update the VERSION argument <min> value or use a ...<max> suffix to tell
        CMake that the project does not need compatibility with older versions.

      -- The C compiler identification is GNU 13.3.0
      -- The CXX compiler identification is GNU 13.3.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/cc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/c++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      CMake Warning (dev) at CMakeLists.txt:33 (EXEC_PROGRAM):
        Policy CMP0153 is not set: The exec_program command should not be called.
        Run "cmake --help-policy CMP0153" for policy details.  Use the cmake_policy
        command to set the policy and suppress this warning.

        Use execute_process() instead.
      This warning is for project developers.  Use -Wno-dev to suppress it.

      CMake Warning (dev) at CMakeLists.txt:34 (EXEC_PROGRAM):
        Policy CMP0153 is not set: The exec_program command should not be called.
        Run "cmake --help-policy CMP0153" for policy details.  Use the cmake_policy
        command to set the policy and suppress this warning.

        Use execute_process() instead.
      This warning is for project developers.  Use -Wno-dev to suppress it.

      libmpg123 found at /usr/lib/x86_64-linux-gnu/libmpg123.so
      -- Configuring done (0.4s)
      -- Generating done (0.0s)
      -- Build files have been written to: /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/build/temp.linux-x86_64-cpython-312
      [  5%] Building CXX object CMakeFiles/pHash.dir/src/ph_fft.cpp.o
      [ 29%] Building CXX object bindings/java/CMakeFiles/pHash-jni.dir/dummy.cpp.o
      [ 29%] Building CXX object CMakeFiles/pHash.dir/src/audiophash.cpp.o
      [ 29%] Building CXX object CMakeFiles/pHash.dir/src/cimgffmpeg.cpp.o
      [ 29%] Building CXX object CMakeFiles/pHash.dir/src/pHash.cpp.o
      make[2]: *** [CMakeFiles/pHash.dir/build.make:76: CMakeFiles/pHash.dir/src/pHash.cpp.o] Error 1
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp: In function ‘int ReadFrames(VFInfo*, cimg_library::CImgList<unsigned char>*, unsigned int, unsigned int)’:
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:69:50: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
         69 |             if (st_info->pFormatCtx->streams[i]->codec->codec_type ==
            |                                                  ^~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:79:65: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
         79 |             st_info->pFormatCtx->streams[st_info->videoStream]->codec;
            |                                                                 ^~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:85:47: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
         85 |         st_info->pCodec = avcodec_find_decoder(st_info->pCodecCtx->codec_id);
            |                           ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            |                                               |
            |                                               const AVCodec*
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:113:9: error: ‘avpicture_get_size’ was not declared in this scope
        113 |         avpicture_get_size(ffmpeg_pixfmt, st_info->width, st_info->height);
            |         ^~~~~~~~~~~~~~~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:117:21: error: ‘AVPicture’ was not declared in this scope; did you mean ‘AVPictureType’?
        117 |     avpicture_fill((AVPicture *)pConvertedFrame, buffer, ffmpeg_pixfmt,
            |                     ^~~~~~~~~
            |                     AVPictureType
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:117:32: error: expected primary-expression before ‘)’ token
        117 |     avpicture_fill((AVPicture *)pConvertedFrame, buffer, ffmpeg_pixfmt,
            |                                ^
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:117:5: error: ‘avpicture_fill’ was not declared in this scope
        117 |     avpicture_fill((AVPicture *)pConvertedFrame, buffer, ffmpeg_pixfmt,
            |     ^~~~~~~~~~~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:138:27: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
        138 |             av_init_packet(&avpkt);
            |             ~~~~~~~~~~~~~~^~~~~~~~
      In file included from /usr/include/x86_64-linux-gnu/libavcodec/avcodec.h:44,
                       from /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.h:36,
                       from /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:25:
      /usr/include/x86_64-linux-gnu/libavcodec/packet.h:629:6: note: declared here
        629 | void av_init_packet(AVPacket *pkt);
            |      ^~~~~~~~~~~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:146:13: error: ‘avcodec_decode_video2’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
        146 |             avcodec_decode_video2(st_info->pCodecCtx, pFrame, &frameFinished,
            |             ^~~~~~~~~~~~~~~~~~~~~
            |             avcodec_decode_subtitle2
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:167:13: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
        167 |             av_free_packet(&packet);
            |             ^~~~~~~~~~~~~~
            |             av_new_packet
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp: In function ‘int NextFrames(VFInfo*, cimg_library::CImgList<unsigned char>*)’:
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:225:50: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
        225 |             if (st_info->pFormatCtx->streams[i]->codec->codec_type ==
            |                                                  ^~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:238:65: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
        238 |             st_info->pFormatCtx->streams[st_info->videoStream]->codec;
            |                                                                 ^~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:241:47: error: invalid conversion from ‘const AVCodec*’ to ‘AVCodec*’ [-fpermissive]
        241 |         st_info->pCodec = avcodec_find_decoder(st_info->pCodecCtx->codec_id);
            |                           ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            |                                               |
            |                                               const AVCodec*
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:271:9: error: ‘avpicture_get_size’ was not declared in this scope
        271 |         avpicture_get_size(ffmpeg_pixfmt, st_info->width, st_info->height);
            |         ^~~~~~~~~~~~~~~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:277:21: error: ‘AVPicture’ was not declared in this scope; did you mean ‘AVPictureType’?
        277 |     avpicture_fill((AVPicture *)pConvertedFrame, buffer, ffmpeg_pixfmt,
            |                     ^~~~~~~~~
            |                     AVPictureType
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:277:32: error: expected primary-expression before ‘)’ token
        277 |     avpicture_fill((AVPicture *)pConvertedFrame, buffer, ffmpeg_pixfmt,
            |                                ^
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:277:5: error: ‘avpicture_fill’ was not declared in this scope
        277 |     avpicture_fill((AVPicture *)pConvertedFrame, buffer, ffmpeg_pixfmt,
            |     ^~~~~~~~~~~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:295:27: warning: ‘void av_init_packet(AVPacket*)’ is deprecated [-Wdeprecated-declarations]
        295 |             av_init_packet(&avpkt);
            |             ~~~~~~~~~~~~~~^~~~~~~~
      /usr/include/x86_64-linux-gnu/libavcodec/packet.h:629:6: note: declared here
        629 | void av_init_packet(AVPacket *pkt);
            |      ^~~~~~~~~~~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:303:13: error: ‘avcodec_decode_video2’ was not declared in this scope; did you mean ‘avcodec_decode_subtitle2’?
        303 |             avcodec_decode_video2(st_info->pCodecCtx, pFrame, &frameFinished,
            |             ^~~~~~~~~~~~~~~~~~~~~
            |             avcodec_decode_subtitle2
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:326:9: error: ‘av_free_packet’ was not declared in this scope; did you mean ‘av_new_packet’?
        326 |         av_free_packet(&packet);
            |         ^~~~~~~~~~~~~~
            |         av_new_packet
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp: In function ‘long int GetNumberVideoFrames(const char*)’:
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:384:41: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
        384 |             if (pFormatCtx->streams[i]->codec->codec_type ==
            |                                         ^~~~~
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp: In function ‘float fps(const char*)’:
      /tmp/pip-install-60k485jl/phashpy_abeddbe8b2c348c9b7afb94b650ce8a8/pHash/src/cimgffmpeg.cpp:438:37: error: ‘AVStream’ {aka ‘struct AVStream’} has no member named ‘codec’
        438 |         if (pFormatCtx->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
            |                                     ^~~~~
      make[2]: *** [CMakeFiles/pHash.dir/build.make:118: CMakeFiles/pHash.dir/src/cimgffmpeg.cpp.o] Error 1
      make[1]: *** [CMakeFiles/Makefile2:125: CMakeFiles/pHash.dir/all] Error 2
      make: *** [Makefile:156: all] Error 2
      Traceback (most recent call last):
        File "/pyenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/pyenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/pyenv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 435, in build_wheel
          return _build(['bdist_wheel', '--dist-info-dir', str(metadata_directory)])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 423, in _build
          return self._build_with_temp_dir(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 404, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 60, in <module>
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 115, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 186, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 202, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1002, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 1102, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/command/bdist_wheel.py", line 370, in run
          self.run_command("build")
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 1102, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 357, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 1102, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-wp7331xn/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 1021, in run_command
          cmd_obj.run()
        File "<string>", line 39, in run
        File "<string>", line 53, in build_cmake
        File "/usr/lib/python3.12/subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['make', '-j']' returned non-zero exit status 2.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pHashPy
Failed to build pHashPy
ERROR: Could not build wheels for pHashPy, which is required to install pyproject.toml-based projects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions