pypi / legacy

This PyPI is no more! See https://github.com/pypa/warehouse.
Other
61 stars 46 forks source link

pip install --upgrade pip installs 10.0.0b2 (beta?) on ubuntu 12.04 #791

Closed lindycoder closed 6 years ago

lindycoder commented 6 years ago

Hello,

First of all we're sorry for bringing 12.04 to the table.

When installing python-pip by apt-get we get pip 1.0. So the first move is to upgrade pip and setuptools ASAP.

The problem is, pip 1.0 seems to install the version 10.0.0b2 which is a beta version we think, and this leads to setuptools failing with this:

pip 1.0 from /usr/lib/python2.7/dist-packages (python 2.7)
Removing intermediate container 31c51d6b2183
 ---> cfdd9c752b0e
Step 4/6 : RUN pip install --upgrade pip -i https://pypi.python.org/simple/
 ---> Running in a435987c0e6b
Downloading/unpacking pip
  Running setup.py egg_info for package pip
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)

    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.mailmap'
    warning: no previously-included files found matching '.travis.yml'
    warning: no previously-included files found matching '.landscape.yml'
    warning: no previously-included files found matching 'src/pip/_vendor/Makefile'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files found matching '*-requirements.txt'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'src/pip/_vendor/six'
    warning: no previously-included files matching '*.pyi' found under directory 'src/pip/_vendor'
    no previously-included directories found matching '.github'
    no previously-included directories found matching '.travis'
    no previously-included directories found matching 'docs/build'
    no previously-included directories found matching 'news'
    no previously-included directories found matching 'contrib'
    no previously-included directories found matching 'tasks'
    no previously-included directories found matching 'tests'
Installing collected packages: pip
  Found existing installation: pip 1.0
    Uninstalling pip:
      Successfully uninstalled pip
  Running setup.py install for pip
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)

    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.mailmap'
    warning: no previously-included files found matching '.travis.yml'
    warning: no previously-included files found matching '.landscape.yml'
    warning: no previously-included files found matching 'src/pip/_vendor/Makefile'
    warning: no previously-included files found matching 'tox.ini'
    warning: no previously-included files found matching '*-requirements.txt'
    warning: no previously-included files found matching 'appveyor.yml'
    warning: no previously-included files found matching 'src/pip/_vendor/six'
    warning: no previously-included files matching '*.pyi' found under directory 'src/pip/_vendor'
    no previously-included directories found matching '.github'
    no previously-included directories found matching '.travis'
    no previously-included directories found matching 'docs/build'
    no previously-included directories found matching 'news'
    no previously-included directories found matching 'contrib'
    no previously-included directories found matching 'tasks'
    no previously-included directories found matching 'tests'
    Installing pip script to /usr/local/bin
    Installing pip2.7 script to /usr/local/bin
    Installing pip2 script to /usr/local/bin
Successfully installed pip
Cleaning up...
Removing intermediate container a435987c0e6b
 ---> d115c20b1ad7
Step 5/6 : RUN pip --version
 ---> Running in 96df697fa919
pip 10.0.0b2 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)
Removing intermediate container 96df697fa919
 ---> 1bf199e16f73
Step 6/6 : RUN pip install -U setuptools
 ---> Running in de2c32bb7554
/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:339: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning
Collecting setuptools
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/basecommand.py", line 228, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/commands/install.py", line 291, in run
    resolver.resolve(requirement_set)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 103, in resolve
    self._resolve_one(requirement_set, req)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 257, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/resolve.py", line 210, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/operations/prepare.py", line 237, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/req/req_install.py", line 307, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index.py", line 484, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index.py", line 442, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index.py", line 587, in _get_pages
    page = self._get_page(location)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index.py", line 705, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/index.py", line 814, in get_page
    "Cache-Control": "max-age=600",
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pip/_internal/download.py", line 397, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/adapter.py", line 42, in send
    cached_response = self.controller.cached_request(request)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/controller.py", line 137, in cached_request
    resp = self.serializer.loads(request, cache_data)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/serialize.py", line 98, in loads
    return getattr(self, "_loads_v{0}".format(ver))(request, data)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/cachecontrol/serialize.py", line 190, in _loads_v4
    cached = msgpack.loads(data, encoding='utf-8')
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/msgpack/fallback.py", line 121, in unpackb
    ret = unpacker._unpack()
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/msgpack/fallback.py", line 600, in _unpack
    ret[key] = self._unpack(EX_CONSTRUCT)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/msgpack/fallback.py", line 600, in _unpack
    ret[key] = self._unpack(EX_CONSTRUCT)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/msgpack/fallback.py", line 560, in _unpack
    typ, n, obj = self._read_header(execute)
  File "/usr/local/lib/python2.7/dist-packages/pip/_vendor/msgpack/fallback.py", line 391, in _read_header
    n = struct.unpack_from(">H", self._buffer, self._buff_i)[0]
TypeError: unpack_from() argument 1 must be string or read-only buffer, not bytearray
/usr/local/lib/python2.7/dist-packages/pip/_vendor/urllib3/util/ssl_.py:137: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
  InsecurePlatformWarning
The command '/bin/sh -c pip install -U setuptools' returned a non-zero code: 2

This is a docker file to reproduce the problem:

FROM ubuntu:12.04
RUN apt-get update && apt-get install -y python-pip

RUN pip --version
RUN pip install --upgrade pip -i https://pypi.python.org/simple/
RUN pip --version
RUN pip install -U setuptools 

We can workaround this by capping pip to 9.0.3 but we were wondering if there's a better solution...

Maybe the debian package could install a better version? (Debian might be mad bro) Maybe pip should not install 10.0.0b2? (but i understand that you don't support pip 1.0) Maybe 10.0.0b2 should not fail at updating setuptools?

Thank you very much for your hard work.

jamadden commented 6 years ago

Thanks for your report, but this query is probably better directed to the pip maintainers at https://github.com/pypa/pip. Or you might consider the distutils-sig mailing list, where the beta release of pip was announced

lindycoder commented 6 years ago

Oh sorry, i followed the "Bug reports" link at https://pypi.python.org/pypi

Thank you!