I need to install this package to build an image recognition tool.
I tried reinstalling Python and also Visual Studio Build Tools, but cannot successfully install Imagededup. It always gives me the wheel error.
I am driving nuts but my skills are basic so might be missing something basic.
I am using Python 3.12.1
`C:Usersr.sousa>pip install imagededup
Collecting imagededup
Using cached imagededup-0.3.1.tar.gz (20.3 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... done
Collecting torch (from imagededup)
Using cached torch-2.3.0-cp312-cp312-win_amd64.whl.metadata (26 kB)
Collecting torchvision (from imagededup)
Using cached torchvision-0.18.0-cp312-cp312-win_amd64.whl.metadata (6.6 kB)
Requirement already satisfied: Pillow>=9.0 in c:usersr.sousaappdatalocalprogramspythonpython312libsite-packages (from imagededup) (10.2.0)
Requirement already satisfied: tqdm in c:usersr.sousaappdatalocalprogramspythonpython312libsite-packages (from imagededup) (4.66.1)
Collecting scikit-learn (from imagededup)
Using cached scikit_learn-1.4.2-cp312-cp312-win_amd64.whl.metadata (11 kB)
Collecting PyWavelets (from imagededup)
Using cached pywavelets-1.6.0-cp312-cp312-win_amd64.whl.metadata (9.0 kB)
Collecting matplotlib (from imagededup)
Using cached matplotlib-3.8.4-cp312-cp312-win_amd64.whl.metadata (5.9 kB)
Collecting contourpy>=1.0.1 (from matplotlib->imagededup)
Using cached contourpy-1.2.1-cp312-cp312-win_amd64.whl.metadata (5.8 kB)
Collecting cycler>=0.10 (from matplotlib->imagededup)
Using cached cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)
Collecting fonttools>=4.22.0 (from matplotlib->imagededup)`
Using cached fonttools-4.51.0-cp312-cp312-win_amd64.whl.metadata (162 kB)
Collecting kiwisolver>=1.3.1 (from matplotlib->imagededup)
Using cached kiwisolver-1.4.5-cp312-cp312-win_amd64.whl.metadata (6.5 kB)
Collecting numpy>=1.21 (from matplotlib->imagededup)
Using cached numpy-1.26.4-cp312-cp312-win_amd64.whl.metadata (61 kB)
Requirement already satisfied: packaging>=20.0 in c:usersr.sousaappdatalocalprogramspythonpython312libsite-packages (from matplotlib->imagededup) (23.2)
Collecting pyparsing>=2.3.1 (from matplotlib->imagededup)
Using cached pyparsing-3.1.2-py3-none-any.whl.metadata (5.1 kB)
Collecting python-dateutil>=2.7 (from matplotlib->imagededup)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB)
Collecting scipy>=1.6.0 (from scikit-learn->imagededup)
Using cached scipy-1.13.0-cp312-cp312-win_amd64.whl.metadata (60 kB)
Collecting joblib>=1.2.0 (from scikit-learn->imagededup)
Using cached joblib-1.4.2-py3-none-any.whl.metadata (5.4 kB)
Collecting threadpoolctl>=2.0.0 (from scikit-learn->imagededup)
Using cached threadpoolctl-3.5.0-py3-none-any.whl.metadata (13 kB)
Collecting filelock (from torch->imagededup)
Using cached filelock-3.14.0-py3-none-any.whl.metadata (2.8 kB)
Requirement already satisfied: typing-extensions>=4.8.0 in c:usersr.sousaappdatalocalprogramspythonpython312libsite-packages (from torch->imagededup) (4.9.0)
Collecting sympy (from torch->imagededup)
Using cached sympy-1.12-py3-none-any.whl.metadata (12 kB)
Collecting networkx (from torch->imagededup)
Using cached networkx-3.3-py3-none-any.whl.metadata (5.1 kB)
Collecting jinja2 (from torch->imagededup)
Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting fsspec (from torch->imagededup)
Using cached fsspec-2024.3.1-py3-none-any.whl.metadata (6.8 kB)
Collecting mkl<=2021.4.0,>=2021.1.1 (from torch->imagededup)
Using cached mkl-2021.4.0-py2.py3-none-win_amd64.whl.metadata (1.4 kB)
Requirement already satisfied: colorama in c:usersr.sousaappdatalocalprogramspythonpython312libsite-packages (from tqdm->imagededup) (0.4.6)
Collecting intel-openmp==2021.* (from mkl<=2021.4.0,>=2021.1.1->torch->imagededup)
Using cached intel_openmp-2021.4.0-py2.py3-none-win_amd64.whl.metadata (1.2 kB)
Collecting tbb==2021.* (from mkl<=2021.4.0,>=2021.1.1->torch->imagededup)
Using cached tbb-2021.12.0-py3-none-win_amd64.whl.metadata (1.1 kB)
Collecting six>=1.5 (from python-dateutil>=2.7->matplotlib->imagededup)
Using cached six-1.16.0-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting MarkupSafe>=2.0 (from jinja2->torch->imagededup)
Using cached MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl.metadata (3.1 kB)
Collecting mpmath>=0.19 (from sympy->torch->imagededup)
Using cached mpmath-1.3.0-py3-none-any.whl.metadata (8.6 kB)
Using cached matplotlib-3.8.4-cp312-cp312-win_amd64.whl (7.7 MB)
Using cached pywavelets-1.6.0-cp312-cp312-win_amd64.whl (4.2 MB)
Using cached scikit_learn-1.4.2-cp312-cp312-win_amd64.whl (10.6 MB)
Using cached torch-2.3.0-cp312-cp312-win_amd64.whl (159.7 MB)
Using cached torchvision-0.18.0-cp312-cp312-win_amd64.whl (1.2 MB)
Using cached contourpy-1.2.1-cp312-cp312-win_amd64.whl (189 kB)
Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)
Using cached fonttools-4.51.0-cp312-cp312-win_amd64.whl (2.2 MB)
Using cached joblib-1.4.2-py3-none-any.whl (301 kB)
Using cached kiwisolver-1.4.5-cp312-cp312-win_amd64.whl (56 kB)
Using cached mkl-2021.4.0-py2.py3-none-win_amd64.whl (228.5 MB)
Using cached intel_openmp-2021.4.0-py2.py3-none-win_amd64.whl (3.5 MB)
Using cached tbb-2021.12.0-py3-none-win_amd64.whl (286 kB)
Using cached numpy-1.26.4-cp312-cp312-win_amd64.whl (15.5 MB)
Using cached pyparsing-3.1.2-py3-none-any.whl (103 kB)
Using cached python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Using cached scipy-1.13.0-cp312-cp312-win_amd64.whl (45.9 MB)
Using cached threadpoolctl-3.5.0-py3-none-any.whl (18 kB)
Using cached filelock-3.14.0-py3-none-any.whl (12 kB)
Using cached fsspec-2024.3.1-py3-none-any.whl (171 kB)
Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Using cached networkx-3.3-py3-none-any.whl (1.7 MB)
Using cached sympy-1.12-py3-none-any.whl (5.7 MB)
Using cached MarkupSafe-2.1.5-cp312-cp312-win_amd64.whl (17 kB)
Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Building wheels for collected packages: imagededup
Building wheel for imagededup (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for imagededup (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [51 lines of output]
C:Usersr.sousaAppDataLocalTemppip-build-env-lq7qgxmgoverlayLibsite-packagessetuptoolsdist.py:476: SetuptoolsDeprecationWarning: Invalid dash-separated options
!!
********************************************************************************
Usage of dash-separated 'description-file' will not be supported in future
versions. Please use the underscore name 'description_file' instead.
By 2024-Sep-26, you need to update your project and remove deprecated calls
or your builds will no longer be supported.
See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
********************************************************************************
!!
opt = self.warn_dash_deprecation(opt, section)
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-cpython-312
creating buildlib.win-amd64-cpython-312imagededup
copying imagededup__init__.py -> buildlib.win-amd64-cpython-312imagededup
creating buildlib.win-amd64-cpython-312imagededupevaluation
copying imagededupevaluationevaluation.py -> buildlib.win-amd64-cpython-312imagededupevaluation
copying imagededupevaluation__init__.py -> buildlib.win-amd64-cpython-312imagededupevaluation
creating buildlib.win-amd64-cpython-312imagededuphandlers
copying imagededuphandlers__init__.py -> buildlib.win-amd64-cpython-312imagededuphandlers
creating buildlib.win-amd64-cpython-312imagededupmethods
copying imagededupmethodscnn.py -> buildlib.win-amd64-cpython-312imagededupmethods
copying imagededupmethodshashing.py -> buildlib.win-amd64-cpython-312imagededupmethods
copying imagededupmethods__init__.py -> buildlib.win-amd64-cpython-312imagededupmethods
creating buildlib.win-amd64-cpython-312imagededuputils
copying imagededuputilsdata_generator.py -> buildlib.win-amd64-cpython-312imagededuputils
copying imagededuputilsgeneral_utils.py -> buildlib.win-amd64-cpython-312imagededuputils
copying imagededuputilsimage_utils.py -> buildlib.win-amd64-cpython-312imagededuputils
copying imagededuputilslogger.py -> buildlib.win-amd64-cpython-312imagededuputils
copying imagededuputilsplotter.py -> buildlib.win-amd64-cpython-312imagededuputils
copying imagededuputils__init__.py -> buildlib.win-amd64-cpython-312imagededuputils
creating buildlib.win-amd64-cpython-312imagededuphandlersmetrics
copying imagededuphandlersmetricsclassification.py -> buildlib.win-amd64-cpython-312imagededuphandlersmetrics
copying imagededuphandlersmetricsinformation_retrieval.py -> buildlib.win-amd64-cpython-312imagededuphandlersmetrics
copying imagededuphandlersmetrics__init__.py -> buildlib.win-amd64-cpython-312imagededuphandlersmetrics
creating buildlib.win-amd64-cpython-312imagededuphandlerssearch
copying imagededuphandlerssearchbktree.py -> buildlib.win-amd64-cpython-312imagededuphandlerssearch
copying imagededuphandlerssearchbrute_force.py -> buildlib.win-amd64-cpython-312imagededuphandlerssearch
copying imagededuphandlerssearchbrute_force_cython.py -> buildlib.win-amd64-cpython-312imagededuphandlerssearch
copying imagededuphandlerssearchretrieval.py -> buildlib.win-amd64-cpython-312imagededuphandlerssearch
copying imagededuphandlerssearch__init__.py -> buildlib.win-amd64-cpython-312imagededuphandlerssearch
running build_ext
building 'brute_force_cython_ext' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for imagededup
Failed to build imagededup
ERROR: Could not build wheels for imagededup, which is required to install pyproject.toml-based projects
C:Usersr.sousa>python pip install pyproject.toml-based
python: can't open file 'C:\Users\r.sousa\pip': [Errno 2] No such file or directory
C:Usersr.sousa>pip install pyproject.toml-based
ERROR: Could not find a version that satisfies the requirement pyproject.toml-based (from versions: none)
ERROR: No matching distribution found for pyproject.toml-based````
I need to install this package to build a image recognition tool.
I tried reinstalling Python and also Visual Studio Build Tools but cannot sucessfully install Imagededup, always gives me the wheel error.
I am driving nuts but my skills are basic so might be missing something basic.
2
Answers
this error typically occurs when the Python package contains a C extension module (in your case, brute_force_cython_ext) that needs to be compiled during installation. The compiler required to build these C extensions on Windows is Microsoft Visual C++.
In-order to resolve your issue, you need to install Microsoft Visual C++ Build Tools 14.0 or greater, which includes the necessary compiler. You can download it from https://visualstudio.microsoft.com/visual-cpp-build-tools/
Apparently the
brute_force_cython_ext
extension cannot be compiled with your setup. While this needs to be fixed somewhere else, you could consider using Python 3.11 for now. I was able to install theimagededup
package on Linux using Python 3.11.7, and on Windows using Python 3.11.8.