smartcrop / smartcrop.py

smartcrop implementation in Python
MIT License
257 stars 32 forks source link

Error: got error while installing #33

Closed brianoy closed 6 months ago

brianoy commented 6 months ago

I got this error when I was installing. python version: 3.12.2

C:\Users\brian>pip install smartcrop
Collecting smartcrop
  Using cached smartcrop-0.4.0-py3-none-any.whl.metadata (4.0 kB)
Requirement already satisfied: numpy in c:\python312\lib\site-packages (from smartcrop) (1.26.4)
Requirement already satisfied: pillow>=4.0.0 in c:\python312\lib\site-packages (from smartcrop) (10.3.0)
Collecting PyGObject (from smartcrop)
  Using cached pygobject-3.48.2.tar.gz (715 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      + meson setup C:\Users\brian\AppData\Local\Temp\pip-install-lt7a9dro\pygobject_9fbe739f7ab84fb49b21fa0fb8b3ae15 C:\Users\brian\AppData\Local\Temp\pip-install-lt7a9dro\pygobject_9fbe739f7ab84fb49b21fa0fb8b3ae15\.mesonpy-pysi6u07 -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dtests=false -Dwheel=true --wrap-mode=nofallback --native-file=C:\Users\brian\AppData\Local\Temp\pip-install-lt7a9dro\pygobject_9fbe739f7ab84fb49b21fa0fb8b3ae15\.mesonpy-pysi6u07\meson-python-native-file.ini
      The Meson build system
      Version: 1.4.0
      Source dir: C:\Users\brian\AppData\Local\Temp\pip-install-lt7a9dro\pygobject_9fbe739f7ab84fb49b21fa0fb8b3ae15
      Build dir: C:\Users\brian\AppData\Local\Temp\pip-install-lt7a9dro\pygobject_9fbe739f7ab84fb49b21fa0fb8b3ae15\.mesonpy-pysi6u07
      Build type: native build
      Project name: pygobject
      Project version: 3.48.2
      C compiler for the host machine: gcc (gcc 10.3.0 "gcc (tdm64-1) 10.3.0")
      C linker for the host machine: gcc ld.bfd 2.36.1
      Host machine cpu family: x86_64
      Host machine cpu: x86_64
      Program python3 found: YES (C:\Python312\python.exe)
      Run-time dependency python found: YES 3.12
      Did not find pkg-config by name 'pkg-config'
      Found pkg-config: NO
      Did not find CMake 'cmake'
      Found CMake: NO
      Run-time dependency gobject-introspection-1.0 found: NO (tried pkgconfig and cmake)
      Not looking for a fallback subproject for the dependency gobject-introspection-1.0 because:
      Use of fallback dependencies is disabled.

      ..\meson.build:29:9: ERROR: Dependency 'gobject-introspection-1.0' is required but not found.

      A full log can be found at C:\Users\brian\AppData\Local\Temp\pip-install-lt7a9dro\pygobject_9fbe739f7ab84fb49b21fa0fb8b3ae15\.mesonpy-pysi6u07\meson-logs\meson-log.txt
      [end of output]

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

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
brianoy commented 6 months ago

Okay, I figure it out. I just remove all python on my computer, downgrade the python version to 3.7.8 and it works.

C:\Users\brian>pip install smartcrop
Collecting smartcrop
  Downloading smartcrop-0.3.4-py3-none-any.whl (7.2 kB)
Requirement already satisfied: Pillow>=4.0.0 in c:\users\brian\appdata\local\programs\python\python37\lib\site-packages (from smartcrop) (9.5.0)
Requirement already satisfied: numpy in c:\users\brian\appdata\local\programs\python\python37\lib\site-packages (from smartcrop) (1.21.6)
Installing collected packages: smartcrop
Successfully installed smartcrop-0.3.4