Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on build docker image: unable to collect setuptools #845

Open
gmmephisto opened this issue Jul 31, 2020 · 4 comments · May be fixed by #846
Open

Error on build docker image: unable to collect setuptools #845

gmmephisto opened this issue Jul 31, 2020 · 4 comments · May be fixed by #846

Comments

@gmmephisto
Copy link

Got an error on building latest docker image with yandex-tank:

Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/2f/8e/38259f4a44944a92068d5ff77230511a4c685604b47a81318f9e5cf2cc24/setuptools-49.2.0.zip (2.2MB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "setuptools/__init__.py", line 21, in <module>
        import setuptools.version
      File "setuptools/version.py", line 1, in <module>
        import pkg_resources
      File "pkg_resources/__init__.py", line 1380
        raise SyntaxError(e) from e
                                ^
    SyntaxError: invalid syntax
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-PzQxmO/setuptools/
You are using pip version 8.1.1, however version 20.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c export DEBIAN_FRONTEND=noninteractive &&     apt-get update &&     apt-get install -yq --no-install-recommends ${BUILD_DEPS} &&     pip install --upgrade setuptools &&     pip install --upgrade pip==9.0.3 &&            pip install https://api.github.com/repos/yandex/yandex-tank/tarball/${BRANCH} &&     apt-get autoremove -y ${BUILD_DEPS} &&     apt-get clean &&     rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/* /tmp/* /var/tmp/* /root/.cache/*' returned a non-zero code: 1

Steps to reproduce:

  • cd docker/
  • docker build .

Possible fix:

  • It would be better to install the latest pip using get-pip.py script from https://bootstrap.pypa.io/ using a python2 interpreter.
@gmmephisto gmmephisto linked a pull request Jul 31, 2020 that will close this issue
@kolypto
Copy link

kolypto commented Sep 21, 2020

+1 on this one

@buhtr
Copy link

buhtr commented Oct 23, 2020

The following solution solves the problem. In a dockerfile Place:

 pip install --upgrade pip==9.0.3 

Above:

 pip install --upgrade setuptools 

It needs to be like this:

...
pip install --upgrade pip==9.0.3 && \
pip install --upgrade setuptools && \
...

@thergbway
Copy link

It needs to be like this:

...
pip install --upgrade pip==9.0.3 && \
pip install --upgrade setuptools && \
...

It works on develop branch and does not work on master, anyway thanks for help

@zhangguanzhang
Copy link

apt-get install python python-pip
pip install --no-cache-dir setuptools==20.7.0
pip install xxx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants