Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Unable to install model-card-toolkit in Colab #283

Open
swsachith opened this issue Jun 9, 2023 · 1 comment
Open

Unable to install model-card-toolkit in Colab #283

swsachith opened this issue Jun 9, 2023 · 1 comment
Labels
installation Installation and dependency problems

Comments

@swsachith
Copy link

Expected Behavior

First cell of both example notebooks:
https://colab.research.google.com/github/tensorflow/model-card-toolkit/blob/main/model_card_toolkit/documentation/examples/Standalone_Model_Card_Toolkit_Demo.ipynb
https://colab.research.google.com/github/tensorflow/model-card-toolkit/blob/master/model_card_toolkit/documentation/examples/Scikit_Learn_Model_Card_Toolkit_Demo.ipynb

fails to install the model-card-toolkit package.

Actual Behavior

fails to install the toolkit.

Steps to Reproduce the Problem

  1. Run the first cells of both notebooks on colab.

Error attached below.

Specifications

  • Version: latest
  • Platform: colab

ERROR: Cannot install model-card-toolkit==1.0.0, model-card-toolkit==1.1.0, model-card-toolkit==1.2.0, model-card-toolkit==1.3.0, model-card-toolkit==1.3.1, model-card-toolkit==1.3.2 and model-card-toolkit==2.0.0 because these package versions have conflicting dependencies.

The conflict is caused by:
model-card-toolkit 2.0.0 depends on tensorflow-data-validation<2.0.0 and >=1.5.0
model-card-toolkit 1.3.2 depends on ml-metadata<1.6.0 and >=1.5.0
model-card-toolkit 1.3.1 depends on ml-metadata<1.6.0 and >=1.5.0
model-card-toolkit 1.3.0 depends on ml-metadata<1.6.0 and >=1.5.0
model-card-toolkit 1.2.0 depends on ml-metadata<1.6.0 and >=1.5.0
model-card-toolkit 1.1.0 depends on ml-metadata<1.3.0 and >=1.2.0
model-card-toolkit 1.0.0 depends on ml-metadata<0.27.0 and >=0.26.0

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict
@codesue
Copy link
Contributor

codesue commented Jun 10, 2023

Thank you for reporting this issue, @swsachith! Colab recently updated to Python 3.10, and some TensorFlow extended libraries don't support this version of Python yet.

Here's the recommended workaround (source):

  1. Run this code in a cell at the top of your notebook to set up an older Python version:

    %%shell
    update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 3
    curl -O https://bootstrap.pypa.io/get-pip.py
    python get-pip.py
  2. In another cell, symlink the google.colab package so that it's on the path of the Python version you want to use:

    !mkdir /usr/local/lib/python3.8/dist-packages/google
    !ln -s /usr/local/lib/python3.10/dist-packages/google/colab /usr/local/lib/python3.8/dist-packages/google/colab
  3. Install the packages and restart your runtime.

In the meantime, you can follow tensorflow/tfx#5897 for updates on when this will be fixed.

@codesue codesue added the installation Installation and dependency problems label Jun 10, 2023
@codesue codesue changed the title Example notebook toolkit installation fails Unable to install model-card-toolkit in Colab Jun 10, 2023
@codesue codesue pinned this issue Jun 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
installation Installation and dependency problems
Projects
None yet
Development

No branches or pull requests

2 participants