Unable to use Anthropic API

App deployed on Community Cloud: Streamlit (mesgen.streamlit.app)

Github repo: balaji99/msgen: An AI-powered tool that enhances messages with emojis, analyzes text for improvements, and provides detailed linguistic feedback. (github.com)

Streamlit version 1.38.0
Python version 3.12

Error message:

────────────────────────────────────────────────────────────────────────────────
ModuleNotFoundError: No module named 'anthropic'
────────────────────── Traceback (most recent call last) ──────────────────────

The app runs fine locally, but not on streamlit community cloud. I have added the requirements.txt file, and listed ‘anthropic’ there.

Hi @Balaji1, welcome to the forum!

I tried deploying your app, and got an error because xml is listed in the dependencies, but that is part of the python standard library, not a pip-installable package.

You can test this locally by doing pip install -r requirements.txt and see if there are errors.

If you remove that, it should work fine – here’s my deployed version https://fncmsujf3fvjbkicyjfqjs.streamlit.app/

Thanks! My app works now. :+1:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.