First dash app build fails due to setuptools

Hi,
I am trying to deploy my first app using render and dash-tools. So naturally I am kind of clueless of all the things happening in the background. I apologize in advance if this is not the right place to post my issue.
When I build the app it fails during package installation. It uninstalls setuptools and tries to install it using setup.py which is deprecated. I just don’t know what package is causing it.
I specifically added setuptools==72.1.0 to avoid something else to delete the 57.4.0 version down the line. This does not work or changes the erroneous behavior.

This is the log:

==> It looks like we don't have access to your repo, but we'll try to clone it anyway.
==> Cloning from https://github.com/SebastianGhafafian/first_render_app
==> Checking out commit xxxxxxxxxxx in branch main
==> Using Python version 3.10.0 via environment variable PYTHON_VERSION
==> Docs on specifying a Python version: https://render.com/docs/python-version
==> Using Poetry version 1.7.1 (default)
==> Docs on specifying a Poetry version: https://render.com/docs/poetry-version
==> Running build command 'pip install -r requirements.txt'...
Collecting setuptools==72.1.0
  Downloading setuptools-72.1.0-py3-none-any.whl (2.3 MB)
Collecting dash==2.16.1
  Downloading dash-2.16.1-py3-none-any.whl (10.2 MB)
Collecting dash_bootstrap_components==1.6.0
  Downloading dash_bootstrap_components-1.6.0-py3-none-any.whl (222 kB)
Collecting numpy==1.24.1
  Downloading numpy-1.24.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.3 MB)
Collecting pandas==1.5.3
  Downloading pandas-1.5.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (12.1 MB)
Collecting plotly==5.22.0
  Downloading plotly-5.22.0-py3-none-any.whl (16.4 MB)
Collecting scipy==1.14.0
  Downloading scipy-1.14.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (41.1 MB)
Collecting gunicorn
  Downloading gunicorn-22.0.0-py3-none-any.whl (84 kB)
Collecting dash-tools
  Downloading dash_tools-1.12.0-py3-none-any.whl (4.7 MB)
Collecting typing-extensions>=4.1.1
  Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Collecting nest-asyncio
  Downloading nest_asyncio-1.6.0-py3-none-any.whl (5.2 kB)
Collecting Flask<3.1,>=1.0.4
  Downloading flask-3.0.3-py3-none-any.whl (101 kB)
Collecting dash-html-components==2.0.0
  Downloading dash_html_components-2.0.0-py3-none-any.whl (4.1 kB)
Collecting Werkzeug<3.1
  Downloading werkzeug-3.0.3-py3-none-any.whl (227 kB)
Collecting requests
  Downloading requests-2.32.3-py3-none-any.whl (64 kB)
Collecting dash-core-components==2.0.0
  Downloading dash_core_components-2.0.0-py3-none-any.whl (3.8 kB)
Collecting dash-table==5.0.0
  Downloading dash_table-5.0.0-py3-none-any.whl (3.9 kB)
Collecting retrying
  Downloading retrying-1.3.4-py3-none-any.whl (11 kB)
Collecting importlib-metadata
  Downloading importlib_metadata-8.2.0-py3-none-any.whl (25 kB)
Collecting pytz>=2020.1
  Downloading pytz-2024.1-py2.py3-none-any.whl (505 kB)
Collecting python-dateutil>=2.8.1
  Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB)
Collecting tenacity>=6.2.0
  Downloading tenacity-9.0.0-py3-none-any.whl (28 kB)
Collecting packaging
  Downloading packaging-24.1-py3-none-any.whl (53 kB)
Collecting pre-commit==2.16.0
  Downloading pre_commit-2.16.0-py2.py3-none-any.whl (191 kB)
Collecting visdcc==0.0.50
  Downloading visdcc-0.0.50.tar.gz (518 kB)
Collecting dash-mantine-components==0.12.0
  Downloading dash_mantine_components-0.12.0-py3-none-any.whl (496 kB)
Collecting yolk3k==0.9
  Downloading yolk3k-0.9.tar.gz (19 kB)
Collecting packaging
  Downloading packaging-21.3-py3-none-any.whl (40 kB)
Collecting dash-iconify==0.1.2
  Downloading dash_iconify-0.1.2-py3-none-any.whl (18 kB)
Collecting ruamel.yaml==0.17.21
  Downloading ruamel.yaml-0.17.21-py3-none-any.whl (109 kB)
Collecting pipreqs==0.4.12
  Downloading pipreqs-0.4.12-py2.py3-none-any.whl (32 kB)
Collecting pytest==6.2.5
  Downloading pytest-6.2.5-py3-none-any.whl (280 kB)
Collecting termcolor==1.1.0
  Downloading termcolor-1.1.0.tar.gz (3.9 kB)
Collecting pyparsing!=3.0.5,>=2.0.2
  Downloading pyparsing-3.1.2-py3-none-any.whl (103 kB)
Collecting docopt
  Downloading docopt-0.6.2.tar.gz (25 kB)
Collecting yarg
  Downloading yarg-0.1.9-py2.py3-none-any.whl (19 kB)
Collecting pyyaml>=5.1
  Downloading PyYAML-6.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (705 kB)
Collecting cfgv>=2.0.0
  Downloading cfgv-3.4.0-py2.py3-none-any.whl (7.2 kB)
Collecting nodeenv>=0.11.1
  Downloading nodeenv-1.9.1-py2.py3-none-any.whl (22 kB)
Collecting identify>=1.0.0
  Downloading identify-2.6.0-py2.py3-none-any.whl (98 kB)
Collecting virtualenv>=20.0.8
  Downloading virtualenv-20.26.3-py3-none-any.whl (5.7 MB)
Collecting toml
  Downloading toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting pluggy<2.0,>=0.12
  Downloading pluggy-1.5.0-py3-none-any.whl (20 kB)
Collecting attrs>=19.2.0
  Downloading attrs-23.2.0-py3-none-any.whl (60 kB)
Collecting py>=1.8.2
  Downloading py-1.11.0-py2.py3-none-any.whl (98 kB)
Collecting iniconfig
  Downloading iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Collecting ruamel.yaml.clib>=0.2.6
  Downloading ruamel.yaml.clib-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (526 kB)
Collecting itsdangerous>=2.1.2
  Downloading itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Collecting blinker>=1.6.2
  Downloading blinker-1.8.2-py3-none-any.whl (9.5 kB)
Collecting click>=8.1.3
  Downloading click-8.1.7-py3-none-any.whl (97 kB)
Collecting Jinja2>=3.1.2
  Downloading jinja2-3.1.4-py3-none-any.whl (133 kB)
Collecting MarkupSafe>=2.0
  Downloading MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting six>=1.5
  Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting distlib<1,>=0.3.7
  Downloading distlib-0.3.8-py2.py3-none-any.whl (468 kB)
Collecting filelock<4,>=3.12.2
  Downloading filelock-3.15.4-py3-none-any.whl (16 kB)
Collecting platformdirs<5,>=3.9.1
  Downloading platformdirs-4.2.2-py3-none-any.whl (18 kB)
Collecting zipp>=0.5
  Downloading zipp-3.19.2-py3-none-any.whl (9.0 kB)
Collecting charset-normalizer<4,>=2
  Downloading charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
Collecting certifi>=2017.4.17
  Downloading certifi-2024.7.4-py3-none-any.whl (162 kB)
Collecting idna<4,>=2.5
  Downloading idna-3.7-py3-none-any.whl (66 kB)
Collecting urllib3<3,>=1.21.1
  Downloading urllib3-2.2.2-py3-none-any.whl (121 kB)
Using legacy 'setup.py install' for termcolor, since package 'wheel' is not installed.
Using legacy 'setup.py install' for visdcc, since package 'wheel' is not installed.
Using legacy 'setup.py install' for yolk3k, since package 'wheel' is not installed.
Using legacy 'setup.py install' for docopt, since package 'wheel' is not installed.
Installing collected packages: pyparsing, MarkupSafe, zipp, Werkzeug, urllib3, tenacity, six, packaging, Jinja2, itsdangerous, idna, click, charset-normalizer, certifi, blinker, typing-extensions, setuptools, retrying, requests, plotly, platformdirs, nest-asyncio, importlib-metadata, Flask, filelock, distlib, dash-table, dash-html-components, dash-core-components, yarg, virtualenv, toml, ruamel.yaml.clib, pyyaml, pytz, python-dateutil, py, pluggy, numpy, nodeenv, iniconfig, identify, docopt, dash, cfgv, attrs, yolk3k, visdcc, termcolor, ruamel.yaml, pytest, pre-commit, pipreqs, pandas, gunicorn, dash-mantine-components, dash-iconify, dash-bootstrap-components, scipy, dash-tools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 57.4.0
    Uninstalling setuptools-57.4.0:
      Successfully uninstalled setuptools-57.4.0
    Running setup.py install for docopt: started
    Running setup.py install for docopt: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /opt/render/project/src/.venv/bin/python3.10 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dh4138em/docopt_446fe6f5747d4d739a7a082e778fde31/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dh4138em/docopt_446fe6f5747d4d739a7a082e778fde31/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vtccaaq6/install-record.txt --single-version-externally-managed --compile --install-headers /opt/render/project/src/.venv/include/site/python3.10/docopt
         cwd: /tmp/pip-install-dh4138em/docopt_446fe6f5747d4d739a7a082e778fde31/
    Complete output (41 lines):
    running install
    /opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
    !!
    
            ********************************************************************************
            Please avoid running ``setup.py`` directly.
            Instead, use pypa/build, pypa/installer or other
            standards-based tools.
    
            See (had to remove link to be able to post this) for details.
            ********************************************************************************
    
    !!
      self.initialize_options()
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-dh4138em/docopt_446fe6f5747d4d739a7a082e778fde31/setup.py", line 6, in <module>
        setup(
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/__init__.py", line 108, in setup
        return distutils.core.setup(**attrs)
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 184, in setup
        return run_commands(dist)
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
        dist.run_commands()
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 970, in run_commands
        self.run_command(cmd)
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/dist.py", line 945, in run_command
        super().run_command(command)
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
        cmd_obj.ensure_finalized()
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
        self.finalize_options()
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/command/install.py", line 62, in finalize_options
        super().finalize_options()
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_distutils/command/install.py", line 407, in finalize_options
        'dist_fullname': self.distribution.get_fullname(),
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_core_metadata.py", line 266, in get_fullname
        return _distribution_fullname(self.get_name(), self.get_version())
      File "/opt/render/project/src/.venv/lib/python3.10/site-packages/setuptools/_core_metadata.py", line 284, in _distribution_fullname
        canonicalize_version(version, strip_trailing_zero=False),
    TypeError: canonicalize_version() got an unexpected keyword argument 'strip_trailing_zero'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /opt/render/project/src/.venv/bin/python3.10 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dh4138em/docopt_446fe6f5747d4d739a7a082e778fde31/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dh4138em/docopt_446fe6f5747d4d739a7a082e778fde31/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-vtccaaq6/install-record.txt --single-version-externally-managed --compile --install-headers /opt/render/project/src/.venv/include/site/python3.10/docopt Check the logs for full command output.
WARNING: You are using pip version 21.2.3; however, version 24.2 is available.
You should consider upgrading via the '/opt/render/project/src/.venv/bin/python3.10 -m pip install --upgrade pip' command.
==> Build failed 😞
==> Common ways to troubleshoot your deploy: https://docs.render.com/troubleshooting-deploys

So it turns out that setting the python version in the environment helped to solve the problem. It is now running fine.

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