Search code examples
pythonclarifai

ImportError: cannot import name 'Workflow' from 'clarifai.rest'


I'm running a .py file and this error shows up:

ImportError: cannot import name 'Workflow' from 'clarifai.rest' (/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/clarifai-2.0.18-py3.10.egg/clarifai/rest/__init__.py)

Solution

  • Clarifai version 2.0.18 doesn't have the Workflow class but the newest version 2.6.2 has. Just update Clarifai with:

    pip install -U clarifai
    

    Note that clarifai package is deprecated and is 3 years already without any update. It's recommended to use the clarifai-grpc instead.