pypa / pypa/setuptools

ImportError: cannot import name 'errors' from 'setuptools' (/opt/render/project/src/.venv/lib/python3.7/site-packages/setuptools/__init__.py) ImportError: cannot import name 'errors' from 'setuptools' (/opt/render/project/src/.venv/lib/python3.7/site-packages/setuptools/__init__.py)

Open
#4,199 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Needs Latest Version Test Needs Simplified Reproducer
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

setuptools version

setuptools==59.8.0

Python version

Python 3.7

OS

Using Render

Additional environment information

This only happens in Render.

Description

I'm trying to deploy a flask app on the web using render. I need python 3.7, because that is the only version supported by one of my necessary libraries. Anyways, when it gets to grpcio, it gives this error:-
ImportError: cannot import name 'errors' from 'setuptools' (/opt/render/project/src/.venv/lib/python3.7/site-packages/setuptools/init.py)

Expected behavior

Install grpcio

How to Reproduce
  1. Make a flask application with grpcio library in the requirements.txt
  2. Deploy it on render
  3. Wait for it to get to grpcio
  4. Look at the error
Output
Collecting google-pasta==0.2.0 (from -r requirements.txt (line 30))
  Downloading https://files.pythonhosted.org/packages/a3/de/c648ef6835192e6e2cc03f40b19eeda4382c49b5bafb43d88b931c4c74ac/google_pasta-0.2.0-py3-none-any.whl (57kB)
Collecting grpcio==1.60.0 (from -r requirements.txt (line 31))
  Downloading https://files.pythonhosted.org/packages/61/38/c615b5c2be690fb31871f294cc08a96e598b085b8d07c5967a5018e0b90c/grpcio-1.60.0.tar.gz (24.8MB)
    ERROR: Command errored out with exit status 1:
     command: /opt/render/project/src/.venv/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-dgirmar6/grpcio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-dgirmar6/grpcio/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
         cwd: /tmp/pip-install-dgirmar6/grpcio/
    Complete output (9 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-dgirmar6/grpcio/setup.py", line 93, in <module>
        import commands
      File "/tmp/pip-install-dgirmar6/grpcio/src/python/grpcio/commands.py", line 31, in <module>
        import support
      File "/tmp/pip-install-dgirmar6/grpcio/src/python/grpcio/support.py", line 21, in <module>
        from setuptools import errors
    ImportError: cannot import name 'errors' from 'setuptools' (/opt/render/project/src/.venv/lib/python3.7/site-packages/setuptools/__init__.py)
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 19.2.3, however version 23.3.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
==> Build failed 😞

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Render/Python 3.7 installation using the requirements.txt entry for grpcio==1.60.0, then inspect grpcio/setup.py and src/python/grpcio/support.py alongside the reported setuptools installation. Confirm the failure path and define done as a successful grpcio installation in the stated environment without the reported ImportError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.