mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

pip install mediapipe-model-maker fails

Open GuyRubi opened this issue 1 year ago • 7 comments

OS Platform and Distribution

MacOS 14.2.1

Compiler version

No response

Programming Language and version

Python 3.10.13

Installed using virtualenv? pip? Conda?(if python)

No response

MediaPipe version

0.10.9

Bazel version

No response

XCode and Tulsi versions (if iOS)

No response

Android SDK and NDK versions (if android)

No response

Android AAR (if android)

None

OpenCV version (if running on desktop)

No response

Describe the problem

Can't install mediapipe-model-maker

Complete Logs

$ python3.10 --version
Python 3.10.13
$ pip3.10 install --upgrade pip
Requirement already satisfied: pip in /opt/homebrew/lib/python3.10/site-packages (23.3.1)
Collecting pip
  Downloading pip-23.3.2-py3-none-any.whl.metadata (3.5 kB)
Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 2.5 MB/s eta 0:00:00
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 23.3.1
    Uninstalling pip-23.3.1:
      Successfully uninstalled pip-23.3.1
Successfully installed pip-23.3.2
$ pip3.10 install mediapipe-model-maker
Collecting mediapipe-model-maker
  Using cached mediapipe_model_maker-0.2.1.3-py3-none-any.whl.metadata (1.6 kB)
Collecting absl-py (from mediapipe-model-maker)
  Using cached absl_py-2.0.0-py3-none-any.whl.metadata (2.3 kB)
Collecting mediapipe>=0.10.0 (from mediapipe-model-maker)
  Downloading mediapipe-0.10.9-cp310-cp310-macosx_11_0_universal2.whl.metadata (9.6 kB)
Collecting numpy (from mediapipe-model-maker)
  Downloading numpy-1.26.3-cp310-cp310-macosx_11_0_arm64.whl.metadata (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 766.4 kB/s eta 0:00:00
Collecting opencv-python (from mediapipe-model-maker)
  Using cached opencv_python-4.9.0.80-cp37-abi3-macosx_11_0_arm64.whl.metadata (20 kB)
Collecting tensorflow>=2.10 (from mediapipe-model-maker)
  Downloading tensorflow-2.15.0-cp310-cp310-macosx_12_0_arm64.whl.metadata (3.6 kB)
Collecting tensorflow-addons (from mediapipe-model-maker)
  Downloading tensorflow_addons-0.23.0-cp310-cp310-macosx_11_0_arm64.whl.metadata (1.7 kB)
Collecting tensorflow-datasets (from mediapipe-model-maker)
  Using cached tensorflow_datasets-4.9.4-py3-none-any.whl.metadata (9.2 kB)
Collecting tensorflow-hub (from mediapipe-model-maker)
  Using cached tensorflow_hub-0.15.0-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting tf-models-official>=2.13.1 (from mediapipe-model-maker)
  Using cached tf_models_official-2.15.0-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting attrs>=19.1.0 (from mediapipe>=0.10.0->mediapipe-model-maker)
  Using cached attrs-23.2.0-py3-none-any.whl.metadata (9.5 kB)
Collecting flatbuffers>=2.0 (from mediapipe>=0.10.0->mediapipe-model-maker)
  Using cached flatbuffers-23.5.26-py2.py3-none-any.whl.metadata (850 bytes)
Collecting matplotlib (from mediapipe>=0.10.0->mediapipe-model-maker)
  Downloading matplotlib-3.8.2-cp310-cp310-macosx_11_0_arm64.whl.metadata (5.8 kB)
Collecting opencv-contrib-python (from mediapipe>=0.10.0->mediapipe-model-maker)
  Using cached opencv_contrib_python-4.9.0.80-cp37-abi3-macosx_11_0_arm64.whl.metadata (20 kB)
Collecting protobuf<4,>=3.11 (from mediapipe>=0.10.0->mediapipe-model-maker)
  Using cached protobuf-3.20.3-py2.py3-none-any.whl (162 kB)
Collecting sounddevice>=0.4.4 (from mediapipe>=0.10.0->mediapipe-model-maker)
  Using cached sounddevice-0.4.6-py3-none-macosx_10_6_x86_64.macosx_10_6_universal2.whl (107 kB)
Collecting tensorflow-macos==2.15.0 (from tensorflow>=2.10->mediapipe-model-maker)
  Downloading tensorflow_macos-2.15.0-cp310-cp310-macosx_12_0_arm64.whl.metadata (4.2 kB)
Collecting astunparse>=1.6.0 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Collecting gast!=0.5.0,!=0.5.1,!=0.5.2,>=0.2.1 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached gast-0.5.4-py3-none-any.whl (19 kB)
Collecting google-pasta>=0.1.1 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)
Collecting h5py>=2.9.0 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Downloading h5py-3.10.0-cp310-cp310-macosx_11_0_arm64.whl.metadata (2.5 kB)
Collecting libclang>=13.0.0 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached libclang-16.0.6-py2.py3-none-macosx_11_0_arm64.whl.metadata (5.2 kB)
Collecting ml-dtypes~=0.2.0 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Downloading ml_dtypes-0.2.0-cp310-cp310-macosx_10_9_universal2.whl.metadata (20 kB)
Collecting opt-einsum>=2.3.2 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached opt_einsum-3.3.0-py3-none-any.whl (65 kB)
Collecting packaging (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached packaging-23.2-py3-none-any.whl.metadata (3.2 kB)
Requirement already satisfied: setuptools in /opt/homebrew/lib/python3.10/site-packages (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker) (68.2.2)
Collecting six>=1.12.0 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting termcolor>=1.1.0 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached termcolor-2.4.0-py3-none-any.whl.metadata (6.1 kB)
Collecting typing-extensions>=3.6.6 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached typing_extensions-4.9.0-py3-none-any.whl.metadata (3.0 kB)
Collecting wrapt<1.15,>=1.11.0 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Downloading wrapt-1.14.1-cp310-cp310-macosx_11_0_arm64.whl (35 kB)
Collecting tensorflow-io-gcs-filesystem>=0.23.1 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Downloading tensorflow_io_gcs_filesystem-0.34.0-cp310-cp310-macosx_12_0_arm64.whl.metadata (14 kB)
Collecting grpcio<2.0,>=1.24.3 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Downloading grpcio-1.60.0-cp310-cp310-macosx_12_0_universal2.whl.metadata (4.0 kB)
Collecting tensorboard<2.16,>=2.15 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached tensorboard-2.15.1-py3-none-any.whl.metadata (1.7 kB)
Collecting tensorflow-estimator<2.16,>=2.15.0 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached tensorflow_estimator-2.15.0-py2.py3-none-any.whl.metadata (1.3 kB)
Collecting keras<2.16,>=2.15.0 (from tensorflow-macos==2.15.0->tensorflow>=2.10->mediapipe-model-maker)
  Using cached keras-2.15.0-py3-none-any.whl.metadata (2.4 kB)
Collecting Cython (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached Cython-3.0.8-py2.py3-none-any.whl.metadata (3.2 kB)
Collecting Pillow (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Downloading pillow-10.2.0-cp310-cp310-macosx_11_0_arm64.whl.metadata (9.7 kB)
Collecting gin-config (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached gin_config-0.5.0-py3-none-any.whl (61 kB)
Collecting google-api-python-client>=1.6.7 (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached google_api_python_client-2.114.0-py2.py3-none-any.whl.metadata (6.6 kB)
Collecting immutabledict (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached immutabledict-4.1.0-py3-none-any.whl.metadata (3.2 kB)
Collecting kaggle>=1.3.9 (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached kaggle-1.6.3.tar.gz (84 kB)
  Preparing metadata (setup.py) ... done
Collecting oauth2client (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached oauth2client-4.1.3-py2.py3-none-any.whl (98 kB)
Collecting opencv-python-headless (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached opencv_python_headless-4.9.0.80-cp37-abi3-macosx_11_0_arm64.whl.metadata (20 kB)
Collecting pandas>=0.22.0 (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Downloading pandas-2.1.4-cp310-cp310-macosx_11_0_arm64.whl.metadata (18 kB)
Collecting psutil>=5.4.3 (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached psutil-5.9.7-cp38-abi3-macosx_11_0_arm64.whl.metadata (21 kB)
Collecting py-cpuinfo>=3.3.0 (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached py_cpuinfo-9.0.0-py3-none-any.whl (22 kB)
Collecting pycocotools (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Downloading pycocotools-2.0.7-cp310-cp310-macosx_10_9_universal2.whl.metadata (1.1 kB)
Collecting pyyaml>=6.0.0 (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Downloading PyYAML-6.0.1-cp310-cp310-macosx_11_0_arm64.whl.metadata (2.1 kB)
Collecting sacrebleu (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached sacrebleu-2.4.0-py3-none-any.whl.metadata (57 kB)
Collecting scipy>=0.19.1 (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Downloading scipy-1.11.4-cp310-cp310-macosx_12_0_arm64.whl.metadata (112 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 112.9/112.9 kB 1.8 MB/s eta 0:00:00
Collecting sentencepiece (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Downloading sentencepiece-0.1.99-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 4.0 MB/s eta 0:00:00
Collecting seqeval (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached seqeval-1.2.2.tar.gz (43 kB)
  Preparing metadata (setup.py) ... done
Collecting tensorflow-model-optimization>=0.4.1 (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached tensorflow_model_optimization-0.7.5-py2.py3-none-any.whl.metadata (914 bytes)
INFO: pip is looking at multiple versions of tf-models-official to determine which version is compatible with other requirements. This could take a while.
Collecting tf-models-official>=2.13.1 (from mediapipe-model-maker)
  Using cached tf_models_official-2.14.2-py2.py3-none-any.whl.metadata (1.4 kB)
  Using cached tf_models_official-2.14.1-py2.py3-none-any.whl.metadata (1.4 kB)
  Using cached tf_models_official-2.14.0-py2.py3-none-any.whl.metadata (1.4 kB)
  Using cached tf_models_official-2.13.2-py2.py3-none-any.whl.metadata (1.4 kB)
  Using cached tf_models_official-2.13.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting pyyaml<5.4.0,>=5.1 (from tf-models-official>=2.13.1->mediapipe-model-maker)
  Using cached PyYAML-5.3.1.tar.gz (269 kB)
  Preparing metadata (setup.py) ... done
Collecting mediapipe-model-maker
  Using cached mediapipe_model_maker-0.2.1.2-py3-none-any.whl.metadata (1.6 kB)
INFO: pip is still looking at multiple versions of tf-models-official to determine which version is compatible with other requirements. This could take a while.
  Using cached mediapipe_model_maker-0.2.1.1-py3-none-any.whl.metadata (1.6 kB)
INFO: This is taking longer than usual. You might need to provide the dependency resolver with stricter constraints to reduce runtime. See https://pip.pypa.io/warnings/backtracking for guidance. If you want to abort this run, press Ctrl + C.
  Using cached mediapipe_model_maker-0.2.1-py3-none-any.whl.metadata (1.6 kB)
  Using cached mediapipe_model_maker-0.2.0-py3-none-any.whl (117 kB)
Collecting tf-models-official==2.11.6 (from mediapipe-model-maker)
  Using cached tf_models_official-2.11.6-py2.py3-none-any.whl (2.4 MB)
Collecting pyyaml<6.0,>=5.1 (from tf-models-official==2.11.6->mediapipe-model-maker)
  Using cached PyYAML-5.4.1.tar.gz (175 kB)
  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
  ╰─> [62 lines of output]
      /opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
      !!

              ********************************************************************************
              The license_file parameter is deprecated, use license_files instead.

              This deprecation is overdue, please update your project and remove deprecated
              calls to avoid build errors in the future.

              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************

      !!
        parsed = self.parsers.get(option_name, lambda x: x)(value)
      running egg_info
      writing lib3/PyYAML.egg-info/PKG-INFO
      writing dependency_links to lib3/PyYAML.egg-info/dependency_links.txt
      writing top-level names to lib3/PyYAML.egg-info/top_level.txt
      Traceback (most recent call last):
        File "/opt/homebrew/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/opt/homebrew/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/opt/homebrew/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 271, in <module>
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 989, in run_command
          super().run_command(command)
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 318, in run
          self.find_sources()
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 326, in find_sources
          mm.run()
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 548, in run
          self.add_defaults()
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/egg_info.py", line 586, in add_defaults
          sdist.add_defaults(self)
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/command/sdist.py", line 113, in add_defaults
          super().add_defaults()
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/command/sdist.py", line 336, in _add_defaults_ext
          self.filelist.extend(build_ext.get_source_files())
        File "<string>", line 201, in get_source_files
        File "/opt/homebrew/Cellar/[email protected]/3.10.13_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 107, in __getattr__
          raise AttributeError(attr)
      AttributeError: cython_sources
      [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.

GuyRubi avatar Jan 16 '24 18:01 GuyRubi

Hi @GuyRubi,

Could you please specifying whether macOS it is based on the Silicon chip or Intel. To reproduce and better understand the issue on our end.

Thank you!!

kuaashish avatar Jan 17 '24 04:01 kuaashish

Hi @kuaashish Apple M3 Max, macOS 14.2.1

GuyRubi avatar Jan 17 '24 16:01 GuyRubi

Hi @GuyRubi,

Unfortunately, you will be not able to install the latest version (0.2.1.3) of MediaPipe model maker because TensorFlow Text stopped supporting Windows, Aarch64, and Apple Macs since version 2.11 (see https://github.com/tensorflow/text#a-note-about-different-operating-system-packages).

To get the latest version, you can try building the tensorflow-text package from their Github. If you are not using the text_classifier task in Model Maker (which needs tensorflow-text), you can try installing it using pip with the "--no-deps" parameter. Install each requirement separately, excluding tensorflow-text. This workaround was suggested by a user here: https://github.com/tensorflow/text/issues/1206 for Windows, and you can do the same for Apple Macs.

Thank you

kuaashish avatar Jan 19 '24 06:01 kuaashish

Thanks for the tip, ill give that a try.

GuyRubi avatar Jan 19 '24 08:01 GuyRubi

Hi @GuyRubi,

Could you kindly update us on the installation status of the latest version of Model Maker on your Apple macOS? Additionally, if you have successfully installed it, could you please share the steps you followed? This information would be beneficial for other community members attempting to use MediaPipe Model Maker on Apple macOS.

Thank you!!

kuaashish avatar Jan 23 '24 12:01 kuaashish

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Jan 31 '24 01:01 github-actions[bot]

Do you think that this represents the installability status for mediapipe in general on Mac M3 (or M1 and higher), or rather confined to Model Maker features?

matanox avatar Feb 04 '24 20:02 matanox

Hi @matanster,

The problem is specific to the Model Maker. MediaPipe functions well without the Model Maker if customization for tasks, like Image Classification, is not needed. However, for customization, Model Maker is essential, and it relies on tensorflow-text, which, in turn, faces issues with Mac silicon ARM-based CPUs.

Thank you!

kuaashish avatar Feb 21 '24 09:02 kuaashish

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] avatar Feb 29 '24 01:02 github-actions[bot]

This issue was closed due to lack of activity after being marked stale for past 7 days.

github-actions[bot] avatar Mar 08 '24 01:03 github-actions[bot]

Are you satisfied with the resolution of your issue? Yes No

google-ml-butler[bot] avatar Mar 08 '24 01:03 google-ml-butler[bot]