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

You should consider upgrading via the 'pip install --upgrade pip' command #8395

Closed
nlevasseur-ix opened this issue Jun 4, 2020 · 9 comments

Comments

@nlevasseur-ix
Copy link

Operating System: Debian GNU/Linux 10 (buster)

  • pip version: 20.1.1
  • Python version: 2.7.16

When i tried to launch this command : sudo docker build -t opencue/rqd -f rqd/Dockerfile .

I have this error message :

Command "python setup.py egg_info" failed with error code 32 in /tmp/pip-build-s_lsiH/setuptools/
You are using pip version 8.1.2, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

I don't understand how i can solve it, pip is up to date and i upgraded pip ...

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Jun 4, 2020
@deveshks
Copy link
Contributor

deveshks commented Jun 4, 2020

This error seems to originate from the docker image you are building from the specified Dockerfile, and if I understand correctly, not from your system pip.

Could you also share the Dockerfile in question?

@nlevasseur-ix
Copy link
Author

yes i'm bulding from Dockerfile, i use this command : docker build -t opencue/rqd -f rqd/Dockerfile and error message appears

@deveshks
Copy link
Contributor

deveshks commented Jun 4, 2020

Can you share the Dockerfile as well. If it is available on a VCS, e.g. github, the repo link would be more helpful.

@nlevasseur-ix
Copy link
Author

nlevasseur-ix commented Jun 4, 2020

the Dockerfile is :

FROM centos:7

RUN yum -y install \
  epel-release \
  gcc \
  python-devel \
  time

RUN yum -y install \
  python-pip \
  python36 \
  python36-devel \
  python36-pip

RUN pip install --upgrade setuptools
RUN pip3.6 install --upgrade setuptools

WORKDIR /opt/opencue

COPY LICENSE ./
COPY requirements.txt ./

RUN pip install -r requirements.txt
RUN pip3.6 install -r requirements.txt

COPY proto/ ./proto
COPY rqd/deploy ./rqd/deploy
COPY rqd/README.md ./rqd/
COPY rqd/setup.py ./rqd/
COPY rqd/tests/ ./rqd/tests
COPY rqd/rqd/ ./rqd/rqd

RUN python3.6 -m grpc_tools.protoc \
  -I=./proto \
  --python_out=./rqd/rqd/compiled_proto \
  --grpc_python_out=./rqd/rqd/compiled_proto \
  ./proto/*.proto

# Fix imports to work in both Python 2 and 3. See
# <https://github.com/protocolbuffers/protobuf/issues/1491> for more info.
RUN sed -i 's/^\(import.*_pb2\)/from . \1/' rqd/rqd/compiled_proto/*.py

# TODO(bcipriano) Lint the code here. (Issue #78)

COPY VERSION.in VERSIO[N] ./
RUN test -e VERSION || echo "$(cat VERSION.in)-custom" | tee VERSION

# Test in Python 2 and 3, but only install in the Python 3 environment.
RUN cd rqd && python setup.py test
RUN cd rqd && python3.6 setup.py test
RUN cd rqd && python3.6 setup.py install

# This step isn't really needed at runtime, but is used when publishing an OpenCue release
# from this build.
RUN versioned_name="rqd-$(cat ./VERSION)-all" \
  && cp LICENSE requirements.txt VERSION rqd/ \
  && mv rqd $versioned_name \
  && tar -cvzf $versioned_name.tar.gz $versioned_name/* \
  && ln -s $versioned_name rqd

# RQD gRPC server
EXPOSE 8444

# NOTE: This shell out is needed to avoid RQD getting PID 0 which leads to leaking child processes.
ENTRYPOINT ["/bin/bash", "-c", "set -e && rqd"]

@deveshks
Copy link
Contributor

deveshks commented Jun 5, 2020

(Just a tip, you can format the code above. Take a look at Quoting code)

I also see that you have already filed an issue against the original repo (AcademySoftwareFoundation/OpenCue#707) and the error occurs on
https://github.com/AcademySoftwareFoundation/OpenCue/blob/master/rqd/Dockerfile#L15

Step 4/26 : RUN pip install --upgrade setuptools
 ---> Running in 651a46936d96
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/25/bf/a37e89d3148221fedd4def62bb68749041d79f3840d58a7943f81a6f6c6e/setuptools-47.1.1.zip (870kB)
    Complete output from command python setup.py egg_info:
    pkg_resources/py2_warn.py:15: UserWarning: Setuptools no longer works on Python 2
    ************************************************************
    Encountered a version of Setuptools that no longer supports
    this version of Python. Please head to
    https://bit.ly/setuptools-py2-sunset for support.
    ************************************************************
      warnings.warn(pre + "*" * 60 + msg + "*" * 60)
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 32 in /tmp/pip-build-i79LHt/setuptools/
You are using pip version 8.1.2, however version 20.1.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
The command '/bin/sh -c pip install --upgrade setuptools' returned a non-zero code: 1

@nlevasseur-ix
Copy link
Author

Hi,

Code is now formated, effectively error occurs on this line :

RUN pip install --upgrade setuptools

@deveshks
Copy link
Contributor

deveshks commented Jun 5, 2020

Hi,

Code is now formated, effectively error occurs on this line :

RUN pip install --upgrade setuptools

The failure stack-trace is actually just

 ---> Running in 651a46936d96
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/25/bf/a37e89d3148221fedd4def62bb68749041d79f3840d58a7943f81a6f6c6e/setuptools-47.1.1.zip (870kB)
    Complete output from command python setup.py egg_info:
    pkg_resources/py2_warn.py:15: UserWarning: Setuptools no longer works on Python 2
    ************************************************************
    Encountered a version of Setuptools that no longer supports
    this version of Python. Please head to
    https://bit.ly/setuptools-py2-sunset for support.
    ************************************************************
      warnings.warn(pre + "*" * 60 + msg + "*" * 60)
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 32 in /tmp/pip-build-i79LHt/setuptools/

The upgrade message is just a suggestion which older pip versions generate so that the user can be notified of upgrading to latest pip, and is not the problem here.

I am not sure which version of python does python-pip contains in the centos:7 image being used by the Dockerfile.

Also looks like RUN pip install --upgrade setuptools is trying to upgrade to setuptools 47.1.1, but according to a URL present in the error message (https://bit.ly/setuptools-py2-sunset), Python 2 support is dropped post setuptools 45.

I tried running the command with the pip I have locally for python 2.7, and the command worked succesfully.

$ python --version
Python 2.7.16

$ pip install --upgrade setuptools
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting setuptools
  Using cached setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 44.1.0
    Uninstalling setuptools-44.1.0:
      Successfully uninstalled setuptools-44.1.0
Successfully installed setuptools-44.1.1

So it might have something to with the pip distributed with centos container as well.

@nlevasseur-ix
Copy link
Author

it's good, i just added : pip install --upgrade pip before RUN pip install --upgrade setuptools in Dockerfile and it's works.

Thanks for your help !

@deveshks
Copy link
Contributor

deveshks commented Jun 5, 2020

it's good, i just added : pip install --upgrade pip before RUN pip install --upgrade setuptools in Dockerfile and it's works.

Thanks for your help !

Great, you can go ahead and close this ticket.

@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Feb 12, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants