mediapipe icon indicating copy to clipboard operation
mediapipe copied to clipboard

Can't pip install mediapipe-model-maker

Open tomershukhman opened this issue 1 year ago • 3 comments

Have I written custom code (as opposed to using a stock example script provided in MediaPipe)

No

OS Platform and Distribution

macos sonoma

Mobile device if the issue happens on mobile device

No response

Browser and version if the issue happens on browser

No response

Programming Language and version

python 3.10

MediaPipe version

No response

Bazel version

No response

Solution

mediapipe-model-maker

Android Studio, NDK, SDK versions (if issue is related to building in Android environment)

No response

Xcode & Tulsi version (if issue is related to building for iOS)

No response

Describe the actual behavior

pip failes due to conflit

Describe the expected behaviour

for it to work...

Standalone code/steps you may have used to try to get what you need

1) tried https://github.com/tensorflow/tensorflow/issues/61719 - no good
2) tried python 3.8 - 3.11 all faid

Other info / Complete Logs

ERROR: Cannot install mediapipe-model-maker==0.1.0.2, mediapipe-model-maker==0.1.1.0 and mediapipe-model-maker==0.1.1.1 because these package versions have conflicting dependencies.

The conflict is caused by:
    mediapipe-model-maker 0.1.1.1 depends on mediapipe==0.9.2.1
    mediapipe-model-maker 0.1.1.0 depends on mediapipe==0.9.2.1
    mediapipe-model-maker 0.1.0.2 depends on mediapipe==0.9.0.1

tomershukhman avatar Mar 11 '24 22:03 tomershukhman

Hi @tomershukhman,

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

To install the latest version, you can try building the tensorflow-text package from their Github if you are using Apple macOS. If you are not using the text_classifier task in Model Maker (which requires tensorflow-text), you can attempt to install it using pip with the "--no-deps" parameter. You would need to install each requirement independently, excluding tensorflow-text. Note that this is a workaround suggested by a user here: https://github.com/tensorflow/text/issues/1206.

Alternatively, you can consider using Colab cloud environment to install these packages in a Linux environment.

Thank you!!

kuaashish avatar Mar 12 '24 09:03 kuaashish

I'm not a python expert and don't need the text_classifier. What commands could I run to get the mediapipe-model-maker working on mac. Have you actually got it working like this (without installing tensorflow-text)?

calbot avatar Aug 29 '24 23:08 calbot

Only way I was able to make it work, it was through using python 3.9.16, with this command : pip install "pyyaml>6.0.0" "keras<3.0.0" "tensorflow<2.16" "tf-models-official<2.16" mediapipe-model-maker --no-deps The list of packages featured in my pip freeze is :

click to expand

absl-py==1.4.0 array-record==0.4.1 astunparse==1.6.3 attrs==24.2.0 bleach==6.1.0 cachetools==5.5.0 certifi==2024.8.30 cffi==1.17.1 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 contourpy==1.3.0 cycler==0.12.1 Cython==3.0.11 distlib==0.3.6 dm-tree==0.1.8 etils==1.5.2 flatbuffers==24.3.25 fonttools==4.53.1 fsspec==2024.9.0 gast==0.6.0 gin-config==0.5.0 google-api-core==2.19.2 google-api-python-client==2.144.0 google-auth==2.34.0 google-auth-httplib2==0.2.0 google-pasta==0.2.0 googleapis-common-protos==1.65.0 grpcio==1.66.1 h5py==3.11.0 httplib2==0.22.0 idna==3.8 immutabledict==4.2.0 importlib_metadata==8.4.0 importlib_resources==6.4.4 jax==0.4.30 jaxlib==0.4.30 joblib==1.4.2 kaggle==1.6.17 keras==2.15.0 kiwisolver==1.4.7 libclang==18.1.1 lxml==5.3.0 Markdown==3.7 markdown-it-py==3.0.0 MarkupSafe==2.1.5 matplotlib==3.9.2 mdurl==0.1.2 mediapipe==0.10.15 mediapipe-model-maker==0.2.1.3 ml-dtypes==0.4.0 namex==0.0.8 numpy==1.26.4 oauth2client==4.1.3 opencv-contrib-python==4.10.0.84 opencv-python==4.10.0.84 opencv-python-headless==4.10.0.84 opt-einsum==3.3.0 optree==0.12.1 packaging==24.1 pandas==2.2.2 pillow==10.4.0 portalocker==2.10.1 promise==2.3 proto-plus==1.24.0 protobuf==4.25.4 psutil==6.0.0 py-cpuinfo==9.0.0 pyasn1==0.6.0 pyasn1_modules==0.4.0 pycocotools==2.0.8 pycparser==2.22 Pygments==2.18.0 pyparsing==3.1.4 python-dateutil==2.9.0.post0 python-slugify==8.0.4 pytz==2024.1 PyYAML==6.0.2 regex==2024.7.24 requests==2.32.3 rich==13.8.0 rsa==4.9 sacrebleu==2.4.3 scikit-learn==1.5.1 scipy==1.13.1 sentencepiece==0.2.0 seqeval==1.2.2 six==1.16.0 sounddevice==0.5.0 tabulate==0.9.0 tensorboard==2.17.1 tensorboard-data-server==0.7.2 tensorflow==2.15.1 tensorflow-addons==0.23.0 tensorflow-datasets==4.9.3 tensorflow-hub==0.16.1 tensorflow-io-gcs-filesystem==0.37.1 tensorflow-metadata==1.13.1 tensorflow-model-optimization==0.8.0 tensorflow-text==2.17.0 termcolor==2.4.0 text-unidecode==1.3 tf-models-official==2.15.0 tf-slim==1.1.0 tf_keras==2.17.0 threadpoolctl==3.5.0 toml==0.10.2 tqdm==4.66.5 typeguard==2.13.3 typing_extensions==4.12.2 tzdata==2024.1 uritemplate==4.1.1 urllib3==2.2.2 virtualenv==20.19.0 webencodings==0.5.1 Werkzeug==3.0.4 wrapt==1.16.0 zipp==3.20.1

olimagsax avatar Sep 06 '24 13:09 olimagsax

Only way I was able to make it work, it was through using python 3.9.16, with this command : pip install "pyyaml>6.0.0" "keras<3.0.0" "tensorflow<2.16" "tf-models-official<2.16" mediapipe-model-maker --no-deps The list of packages featured in my pip freeze is :

click to expand

This worked for me. Thank you so much @olimagsax

AryanK1511 avatar Nov 24 '24 09:11 AryanK1511

In case the above from @olimagsax does not work for you like it did not for me... I was able to get things going like this:

  • Python 3.9.16
  • pip install -r requirements.txt
  • pip install mediapipe-model-maker==0.2.1.3 --no-deps
  • pip install tf-models-official==2.14.2 --no-deps

The ugly requirements.txt file in question:

absl-py==1.4.0
array-record==0.4.1
astunparse==1.6.3
attrs==24.2.0
bleach==6.1.0
cachetools==5.5.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.3.2
click==8.1.7
colorama==0.4.6
contourpy==1.3.0
cycler==0.12.1
Cython==3.0.11
distlib==0.3.6
dm-tree==0.1.8
etils==1.5.2
flatbuffers==24.3.25
fonttools==4.53.1
fsspec==2024.9.0
gast==0.6.0
gin-config==0.5.0
google-api-core==2.19.2
google-api-python-client==2.144.0
google-auth==2.34.0
google-auth-httplib2==0.2.0
google-pasta==0.2.0
googleapis-common-protos==1.65.0
grpcio==1.66.1
h5py==3.11.0
httplib2==0.22.0
idna==3.8
immutabledict==4.2.0
importlib_metadata==8.4.0
importlib_resources==6.4.4
jax==0.4.30
jaxlib==0.4.30
joblib==1.4.2
kaggle==1.6.17
keras==2.15.0
kiwisolver==1.4.7
libclang==18.1.1
lxml==5.3.0
Markdown==3.7
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.9.2
mdurl==0.1.2
mediapipe==0.10.15
ml-dtypes==0.3.2
namex==0.0.8
numpy==1.26.4
oauth2client==4.1.3
opencv-contrib-python==4.10.0.84
opencv-python==4.10.0.84
opencv-python-headless==4.10.0.84
opt-einsum==3.3.0
optree==0.12.1
packaging==24.1
pandas==2.2.2
pillow==10.4.0
portalocker==2.10.1
promise==2.3
proto-plus==1.24.0
protobuf==4.25.4
psutil==6.0.0
py-cpuinfo==9.0.0
pyasn1==0.6.0
pyasn1_modules==0.4.0
pycocotools==2.0.8
pycparser==2.22
Pygments==2.18.0
pyparsing==3.1.4
python-dateutil==2.9.0.post0
python-slugify==8.0.4
pytz==2024.1
PyYAML==6.0.2
regex==2024.7.24
requests==2.32.3
rich==13.8.0
rsa==4.9
sacrebleu==2.4.3
scikit-learn==1.5.1
scipy==1.13.1
sentencepiece==0.2.0
seqeval==1.2.2
six==1.16.0
sounddevice==0.5.0
tabulate==0.9.0
tensorboard==2.15.2
tensorboard-data-server==0.7.2
tensorflow==2.15.1
tensorflow-addons==0.23.0
tensorflow-datasets==4.9.3
tensorflow-hub==0.16.1
tensorflow-io-gcs-filesystem==0.37.1
tensorflow-metadata==1.13.1
tensorflow-model-optimization==0.7.5
termcolor==2.4.0
text-unidecode==1.3
tf-slim==1.1.0
tf_keras==2.14.1
threadpoolctl==3.5.0
toml==0.10.2
tqdm==4.66.5
typeguard==2.13.3
typing_extensions==4.12.2
tzdata==2024.1
uritemplate==4.1.1
urllib3==2.2.2
virtualenv==20.19.0
webencodings==0.5.1
Werkzeug==3.0.4
wrapt==1.14.1
zipp==3.20.1

blakerutledge-g avatar Jun 26 '25 18:06 blakerutledge-g

Only way I was able to make it work, it was through using python 3.9.16, with this command : pip install "pyyaml>6.0.0" "keras<3.0.0" "tensorflow<2.16" "tf-models-official<2.16" mediapipe-model-maker --no-deps The list of packages featured in my pip freeze is : click to expand

This worked for me too, thank you !

BrunoSantome avatar Oct 29 '25 18:10 BrunoSantome

Hi @olimagsax thanks for the workaround,

@tomershukhman if this helps feel free to close this issue, 😊

HarishPermal avatar Nov 03 '25 04:11 HarishPermal

Would still love for this to be resolved properly and not close the issue -- the current workaround is very brittle and only works for the time being, no guarantee it will continue to work. This package should be marked as unsupported or deprecated if it will continue to fail a simple pip install and a googler wont fix it

blakerutledge-g avatar Nov 03 '25 16:11 blakerutledge-g

Would still love for this to be resolved properly and not close the issue -- the current workaround is very brittle and only works for the time being, no guarantee it will continue to work. This package should be marked as unsupported or deprecated if it will continue to fail a simple pip install and a googler wont fix it

I understand your frustration it's definitely not an ideal situation when a simple pip install fails.

While we wait for the permanent fix in the next release, In the meantime you can give this a try this should resolve the installation issue for now. and let me know

HarishPermal avatar Nov 04 '25 09:11 HarishPermal

Is there a permanent fix coming?

On Tue, Nov 4, 2025 at 2:49 AM HarishPermal @.***> wrote:

HarishPermal left a comment (google-ai-edge/mediapipe#5214) https://github.com/google-ai-edge/mediapipe/issues/5214#issuecomment-3484962815

Would still love for this to be resolved properly and not close the issue -- the current workaround is very brittle and only works for the time being, no guarantee it will continue to work. This package should be marked as unsupported or deprecated if it will continue to fail a simple pip install and a googler wont fix it

I understand your frustration it's definitely not an ideal situation when a simple pip install fails.

While we wait for the permanent fix in the next release, In the meantime you can give this https://github.com/google-ai-edge/mediapipe/issues/6081#issuecomment-3290462822 a try this should resolve the installation issue for now. and let me know

— Reply to this email directly, view it on GitHub https://github.com/google-ai-edge/mediapipe/issues/5214#issuecomment-3484962815, or unsubscribe https://github.com/notifications/unsubscribe-auth/BNV5KSNCB7MIU5MXUUMIBD333BZELAVCNFSM6AAAAACAHBEH52VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIOBUHE3DEOBRGU . You are receiving this because you commented.Message ID: @.***>

blakerutledge-g avatar Nov 04 '25 15:11 blakerutledge-g