Build "can not execute setup.py since setuptools is not available"

I’m trying to deploy my first blueprint, and running into an issue that I’m not understanding. I’ve got a Django project, and from what I can understand, one of my dependencies has a dependency and for some reason that sub-dependency’s setup.py isn’t working. But I can’t figure out what’s going wrong, or whether there is anything I can do about this. The package all works fine when I’m running it on my local development environment.

Here are the details from my build log:

==> Cloning from https://github.com/xxxxxx..
==> Checking out commit xxxxxx in branch main
==> Downloading cache...
==> Downloaded 37MB in 5s. Extraction took 2s.
==> Using Python version: 3.10.4
==> Running build command './build.sh'...
Installing dependencies from lock file
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.

Package operations: 35 installs, 0 updates, 1 removal

  • Removing setuptools (62.1.0)
  • Installing asgiref (3.5.0)
  • Installing sqlparse (0.4.2)
  • Installing django (4.0.4)
  • Installing pyparsing (3.0.8)
  • Installing six (1.16.0)
  • Installing webencodings (0.5.1)
  • Installing attrs (21.4.0)
  • Installing bleach (5.0.0)
  • Installing brotli (1.0.9)
  • Installing certifi (2021.10.8)
  • Installing charset-normalizer (2.0.12)
  • Installing confusable-homoglyphs (3.2.0)
  • Installing idna (3.3)
  • Installing more-itertools (8.12.0)
  • Installing persisting-theory (0.2.1)
  • Installing jsonfield (3.1.0)
  • Installing phonenumbers (8.12.46)
  • Installing packaging (21.3)
  • Installing pluggy (0.13.1)
  • Installing py (1.11.0)
  • Installing pytz (2022.1)
  • Installing urllib3 (1.26.9)
  • Installing wcwidth (0.2.5)

  EnvCommandError

  Command ['/opt/render/project/src/.venv/bin/pip', 'install', '--no-deps', 'file:///opt/render/.cache/.python-poetry/cache/artifacts/bb/60/32/52ca929433fd2dbcfe99ca3b264ac14b5812db6fa718696c58c53b553a/persisting-theory-0.2.1.tar.gz'] errored with the following return code 1, and output:
  Processing /opt/render/.cache/.python-poetry/cache/artifacts/bb/60/32/52ca929433fd2dbcfe99ca3b264ac14b5812db6fa718696c58c53b553a/persisting-theory-0.2.1.tar.gz
    Preparing metadata (setup.py): started
    Preparing metadata (setup.py): finished with status 'error'
    error: subprocess-exited-with-error

    × python setup.py egg_info did not run successfully.
    │ exit code: 1
    ╰─> [1 lines of output]
        ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
        [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
  error: metadata-generation-failed

  × Encountered error while generating package metadata.
  ╰─> See above for output.

  note: This is an issue with the package mentioned above, not pip.
  hint: See above for details.

From what I understand, it sounds like Render is somehow unhappy with the “persisting-theory” package. But I don’t know what I can do about it…

Help? Thanks.

And I do see that “Removing setuptools” in the first line package operations, but I don’t know why it is doing that… I’ve tried even specifically adding setuptools into my poetry package.

Hi Dan,

It appears that there may be some version incompatibilities with setuptools. I’m not super familiar with how Python package management works, so I’m not sure if this includes the solution to the issue you’re running into, but I wanted to flag it in case it’s helpful.

Yeah I actually found that thread as well. The issue appears to actually be with Poetry rather than SetupTools, and is fixed in the Poetry Preview release 1.2.0b1. If somehow I could get my project to use that version on Render, I’d be all good…

I asked that in another thread, and sounds like I might need to make this a Docker in order to get that.

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