Distutil Error: Pip Version Build Fail

I am trying to deploy my latest commit which includes a secret key and value. I have added my variable to .env, and have imported both ‘import os’ and ‘from dotenv import load_dotenv’, using “load_dotenv()” and then “os.getenv(‘enginekey’)” in the appropriate place. I also added the .env in secret files in render/environments. This version I can not deploy to render because it raises the error below.

raise DistutilsError(str(e))
Mar 22 03:14:52 PM distutils.errors.DistutilsError: Command ‘[’/opt/render/project/src/.venv/bin/python’, ‘-m’, ‘pip’, ‘–disable-pip-version-check’, ‘wheel’, ‘–no-deps’, ‘-w’, ‘/tmp/tmpvtmpigvc’, ‘–quiet’, ‘distribute’]’ returned non-zero exit status 1.
Mar 22 03:14:52 PM ----------------------------------------
Mar 22 03:14:52 PM ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Mar 22 03:14:52 PM WARNING: You are using pip version 20.1.1; however, version 23.0.1 is available.

I already have pip 23.0.1 on vscode, and I don’t know if I need to upgrade pip through render, don’t know how to do it. Can you please help?

Hi,

You could try upgrading pip, the command is usually shown on the next line after the logs you shared, e.g. a Build Command of:

pip install --upgrade pip && pip install -r requirements.txt

Also ensure you’re specifying a Python version to match the one you developed on.

Alan

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