Cannot deploy app due to error of cannot load tomllib

Hello,

I am trying to deploy and app. I am using tomillib in requirement.txt. It seems to be tripping up Streamlit when deploying. tomillib is a core python library starting Python 3.11. Shouldn’t Streamlit support a standard Python library?
https://docs.python.org/3/library/tomllib.html#module-tomllib

Here’s the error message.
ERROR: Could not find a version that satisfies the requirement tomllib (from versions: none)
ERROR: No matching distribution found for tomllib
WARNING: You are using pip version 22.0.3; however, version 24.0 is available.
You should consider upgrading via the ‘/home/adminuser/venv/bin/python -m pip install --upgrade pip’ command.
Checking if Streamlit is installed

Hi @shuynh

By default, apps are deployed using Python 3.9 and you can change this when deploying the app.

More info in the Docs:

Here’s a screenshot where you can select a Python version of your choice:

Hello @dataprofessor,

I did pick Python 3.11 in the advanced settings. Not sure why it’s still giving me this error.
Thanks,
Nal

Hmm, that’s interesting. Would explicitly specifying the library in the requirements.txt file help?

Hi @dataprofessor, I do have it explicitly listed in the requirements.txt as below. Still have the same error.

streamlit>=1.32.2,<2.0.0
chardet>=5.2.0,<6.0.0
openai>=1.14.2,<2.0.0
tomllib

@dataprofessor user error! Please disregard this. I fixed the error already. Thank you for your help!

Hi @shuynh

Glad to hear that the issue has been resolved!

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