EnvCommandError - cannot get django tutorial to deploy

I’ve tried to get a test deploy of the django tutorial deployed but cannot get it to work. I created an environment variable to get render to use python 3.8.2 but when deploying I get the following EnvCommandError errors:

Curiously it looks like its removing setup tools at the start but I’m not sure if that is the cause of the issue

Oct 16 08:24:12 PM ==> Downloading cache…
Oct 16 08:24:22 PM ==> Transferred 11MB in 8s. Extraction took 0s.
Oct 16 08:24:34 PM ==> Using Python version: 3.8.2
Oct 16 08:24:37 PM ==> Running build command ‘./build.sh’…
Oct 16 08:24:39 PM Installing dependencies from lock file
Oct 16 08:24:39 PM Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them.
Oct 16 08:24:39 PM
Oct 16 08:24:39 PM Package operations: 14 installs, 0 updates, 1 removal
Oct 16 08:24:39 PM
Oct 16 08:24:39 PM • Removing setuptools (65.5.0)
Oct 16 08:24:40 PM • Installing asgiref (3.5.2)
Oct 16 08:24:40 PM • Installing certifi (2022.9.24)
Oct 16 08:24:40 PM • Installing charset-normalizer (2.1.1)
Oct 16 08:24:40 PM • Installing idna (3.4)
Oct 16 08:24:40 PM • Installing sqlparse (0.4.3)
Oct 16 08:24:40 PM • Installing urllib3 (1.26.12)
Oct 16 08:24:42 PM • Installing django (4.1.2)
Oct 16 08:24:42 PM • Installing requests (2.28.1)
Oct 16 08:24:42 PM • Installing websocket-client (1.4.1)
Oct 16 08:24:42 PM • Installing websockets (10.3)
Oct 16 08:24:47 PM • Installing dj-database-url (1.0.0)
Oct 16 08:24:47 PM • Installing gunicorn (20.1.0)
Oct 16 08:24:47 PM • Installing psycopg2-binary (2.9.4)
Oct 16 08:24:47 PM • Installing pybit (2.4.1)
Oct 16 08:24:48 PM
Oct 16 08:24:48 PM EnvCommandError
Oct 16 08:24:48 PM
Oct 16 08:24:48 PM Command [‘/opt/render/project/src/.venv/bin/pip’, ‘install’, ‘–no-deps’, ‘file:///opt/render/.cache/.python-poetry/cache/artifacts/e9/a0/1e/1df7d45319ab2a176a5ceb6e316d21758aacd3418b7838471cd80bdcc1/pybit-2.4.1.tar.gz’] errored with the following return code 1, and output:
Oct 16 08:24:48 PM Processing /opt/render/.cache/.python-poetry/cache/artifacts/e9/a0/1e/1df7d45319ab2a176a5ceb6e316d21758aacd3418b7838471cd80bdcc1/pybit-2.4.1.tar.gz
Oct 16 08:24:48 PM ERROR: Command errored out with exit status 1:
Oct 16 08:24:48 PM command: /opt/render/project/src/.venv/bin/python3.8 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-req-build-i54c87d_/setup.py’“'”‘; file=’“'”‘/tmp/pip-req-build-i54c87d_/setup.py’“'”‘;f=getattr(tokenize, ‘"’“‘open’”’“‘, open)(file);code=f.read().replace(’”‘"’\r\n’“'”‘, ‘"’"’\n’“'”‘);f.close();exec(compile(code, file, ‘"’“‘exec’”’"‘))’ egg_info --egg-base pip-egg-info
Oct 16 08:24:48 PM cwd: /tmp/pip-req-build-i54c87d_/
Oct 16 08:24:48 PM Complete output (3 lines):
Oct 16 08:24:48 PM Traceback (most recent call last):
Oct 16 08:24:48 PM File “”, line 1, in
Oct 16 08:24:48 PM ModuleNotFoundError: No module named ‘setuptools’
Oct 16 08:24:48 PM ----------------------------------------
Oct 16 08:24:48 PM ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Oct 16 08:24:48 PM WARNING: You are using pip version 19.2.3, however version 22.3 is available.
Oct 16 08:24:48 PM You should consider upgrading via the ‘pip install --upgrade pip’ command.
Oct 16 08:24:48 PM
Oct 16 08:24:48 PM
Oct 16 08:24:48 PM at /home/render/.python-poetry/venv/lib/python3.7/site-packages/poetry/utils/env.py:1195 in run
Oct 16 08:24:49 PM 1191│ output = subprocess.check_output(
Oct 16 08:24:49 PM 1192│ cmd, stderr=subprocess.STDOUT, **kwargs
Oct 16 08:24:49 PM 1193│ )
Oct 16 08:24:49 PM 1194│ except CalledProcessError as e:
Oct 16 08:24:49 PM → 1195│ raise EnvCommandError(e, input=input
)
Oct 16 08:24:49 PM 1196│
Oct 16 08:24:49 PM 1197│ return decode(output)
Oct 16 08:24:49 PM 1198│
Oct 16 08:24:49 PM 1199│ def execute(self, bin, *args, **kwargs):
Oct 16 08:24:49 PM
Oct 16 08:24:49 PM
Oct 16 08:24:49 PM EnvCommandError
Oct 16 08:24:49 PM
Oct 16 08:24:49 PM Command [‘/opt/render/project/src/.venv/bin/pip’, ‘install’, ‘–no-deps’, ‘file:///opt/render/.cache/.python-poetry/cache/artifacts/e0/63/30/d513e0c3c2f0b642bf90dfb4bb399b33b4d3fae1f345ccc17a3f3d325a/psycopg2_binary-2.9.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl’] errored with the following return code 1, and output:
Oct 16 08:24:49 PM ERROR: psycopg2_binary-2.9.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl is not a supported wheel on this platform.
Oct 16 08:24:49 PM WARNING: You are using pip version 19.2.3, however version 22.3 is available.
Oct 16 08:24:49 PM You should consider upgrading via the ‘pip install --upgrade pip’ command.
Oct 16 08:24:49 PM
Oct 16 08:24:49 PM
Oct 16 08:24:49 PM at /home/render/.python-poetry/venv/lib/python3.7/site-packages/poetry/utils/env.py:1195 in run
Oct 16 08:24:49 PM 1191│ output = subprocess.check_output(
Oct 16 08:24:49 PM 1192│ cmd, stderr=subprocess.STDOUT, **kwargs
Oct 16 08:24:49 PM 1193│ )
Oct 16 08:24:49 PM 1194│ except CalledProcessError as e:
Oct 16 08:24:49 PM → 1195│ raise EnvCommandError(e, input=input
)
Oct 16 08:24:49 PM 1196│
Oct 16 08:24:49 PM 1197│ return decode(output)
Oct 16 08:24:49 PM 1198│
Oct 16 08:24:49 PM 1199│ def execute(self, bin, *args, **kwargs):
Oct 16 08:24:49 PM
Oct 16 08:24:49 PM ==> Build failed :disappointed:

Hi,

Can you share a public repo with us that we can use to repro the issue? It will enable us to investigate this and find a fix faster.

This is the repo producing the error:

Hello,

Took a look at your repo-example.
Possibly there are some python version conflicts?

In your deploy log above you specified python 3.8.2 which it uses, but then poetry is using 3.7 .python-poetry/venv/lib/python3.7

This section is looking for ^3.10

Take a look at our example repo for Django

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