Deployment Failing: distutils error despite using .python-version

Hello,

My Streamlit app is failing to deploy with the error ModuleNotFoundError: No module named 'distutils'. This indicates the app is being built in a Python 3.12 environment.

To resolve this, I have taken the following steps, but the error persists:

  1. Added setuptools>=65.5.0 to my requirements.txt to ensure modern packaging tools are used.
  2. Added a .python-version file to my repository containing 3.11 to explicitly force the app to build in a compatible Python environment.
  3. Confirmed all files are correct in the public GitHub repository.
  4. Attempted to reboot, as well as fully delete and redeploy the app multiple times.

Despite these steps, the build log continues to show the distutils error, suggesting the .python-version file is not being respected by the build process.

Here is the link to my public GitHub repository:

Could you please advise on how to resolve this platform issue? Thank you.

Hi @victor19,

In order to set the version of Python in your Community Cloud app, you need to set the version in the app settings. Community Cloud does not support configuring the Python version through any kind of file.

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