Skip to content

Error when installing buildbot-slave in pip 7.0.0 and later #2996

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

Closed
vitaut opened this issue Jul 30, 2015 · 4 comments
Closed

Error when installing buildbot-slave in pip 7.0.0 and later #2996

vitaut opened this issue Jul 30, 2015 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation

Comments

@vitaut
Copy link

vitaut commented Jul 30, 2015

I get an error when installing buildbot-slave using pip 7.0.0 - 7.1.0:

# pip install buildbot-slave
Collecting buildbot-slave
/usr/local/lib/python2.6/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading buildbot-slave-0.8.12.tar.gz (118kB)
    100% |################################| 118kB 3.3MB/s 
Collecting twisted>=8.0.0 (from buildbot-slave)
  Downloading Twisted-15.2.1.tar.bz2 (4.6MB)
    100% |################################| 4.6MB 160kB/s 
Collecting zope.interface>=3.6.0 (from twisted>=8.0.0->buildbot-slave)
  Downloading zope.interface-4.1.2.tar.gz (919kB)
    100% |################################| 921kB 792kB/s 
Requirement already satisfied (use --upgrade to upgrade): setuptools in /usr/local/lib/python2.6/dist-packages (from zope.interface>=3.6.0->twisted>=8.0.0->buildbot-slave)
Building wheels for collected packages: buildbot-slave, twisted, zope.interface
  Running setup.py bdist_wheel for buildbot-slave
  Stored in directory: //.cache/pip/wheels/34/64/c3/3efbca6046b0bbe09f8386890bf3865f3caba5ba7534e7af1f
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.6/dist-packages/pip/basecommand.py", line 223, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.6/dist-packages/pip/commands/install.py", line 293, in run
    wb.build(autobuilding=True)
  File "/usr/local/lib/python2.6/dist-packages/pip/wheel.py", line 787, in build
    build_failure.append(req)
  File "/usr/lib/python2.6/contextlib.py", line 34, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python2.6/dist-packages/pip/utils/logging.py", line 36, in indent_log
    yield
  File "/usr/local/lib/python2.6/dist-packages/pip/wheel.py", line 785, in build
    session=self.requirement_set.session)
  File "/usr/local/lib/python2.6/dist-packages/pip/download.py", line 814, in unpack_url
    unpack_file_url(link, location, download_dir)
  File "/usr/local/lib/python2.6/dist-packages/pip/download.py", line 723, in unpack_file_url
    unpack_file(from_path, location, content_type, link)
  File "/usr/local/lib/python2.6/dist-packages/pip/utils/__init__.py", line 644, in unpack_file
    flatten=not filename.endswith('.whl')
  File "/usr/local/lib/python2.6/dist-packages/pip/utils/__init__.py", line 528, in unzip_file
    zipfp = open(filename, 'rb')
IOError: [Errno 2] No such file or directory: '/\\\\.cache/pip/wheels/34/64/c3/3efbca6046b0bbe09f8386890bf3865f3caba5ba7534e7af1f/buildbot_slave-0.8.12-py2-none-any.whl'

The same package installs correctly with pip version 6.1.1.

vitaut added a commit to ampl/mp that referenced this issue Jul 30, 2015
because buildbot-slave installation is broken in pip 7.0.0:
pypa/pip#2996
@xavfernandez
Copy link
Member

Does not look like it's related to buildbot-slave: pip seems to build a wheel successfully for it in
//.cache/pip/wheels/34/64/c3/3efbca6046b0bbe09f8386890bf3865f3caba5ba7534e7af1f but does not find it a few lines after...

Could you retry the install and check what is in the directory reported here:

Building wheels for collected packages: buildbot-slave, twisted, zope.interface
  Running setup.py bdist_wheel for buildbot-slave
  Stored in directory:  *THIS DIRECTORY*

Did you try running pip install twisted alone for example to check if it is buildbot-slave specific ?
And what is you OS ? And the content of the environment variable $HOME ? (you seem to be running as root)

For the record, pip 7.1.0 seems to install correctly buildbot-slave on my end.

@vitaut
Copy link
Author

vitaut commented Aug 4, 2015

The directory //.cache/pip/wheels/34/64/c3/3efbca6046b0bbe09f8386890bf3865f3caba5ba7534e7af1f specified in "Stored in this directory" contains a single file buildbot_slave-0.8.12-py2-none-any.whl.

Similar error occurs when I try to install twisted:

IOError: [Errno 2] No such file or directory: '/home/\\\\.cache/pip/wheels/a0/10/c4/3b2e14dad063e87d188eb2503861413db1fea43ded77834299/zope.interface-4.1.2-cp26-none-linux_x86_64.whl'

Note that in both cases the problem is that the paths contain extra \\\\.

The error occurs on a Docker box running Ubuntu 10.04 and $HOME is set to / (not sure why, but it's a throwaway box, so I didn't care to change anything).

@xavfernandez
Copy link
Member

Ok, for the record, that's what I'm getting:

>>> import os
>>> os.getenv("XDG_CACHE_HOME", os.path.expanduser("~/.cache"))
'//.cache'

Which is certainly transformed in pip into:

In [1]: from pip.download import path_to_url, url_to_path

In [2]: path_to_url('//.cache/path_to_some_wheel.whl')
Out[2]: 'file://.cache/path_to_some_wheel.whl'

Which unfortunately transformed back to:

In [3]: url_to_path('file://.cache/path_to_some_wheel.whl')
Out[3]: '\\\\.cache/path_to_some_wheel.whl'

In the meantime, running HOME=/root pip install buildbot-slave, seems to work.

@vitaut
Copy link
Author

vitaut commented Aug 5, 2015

Thanks for the workaround, setting HOME to something other than / does solve the problem. It would be nice if it worked with HOME=/ too because this seems to be the default on many Docker images.

rouge8 pushed a commit to rouge8/pip that referenced this issue Sep 29, 2015
rouge8 pushed a commit to rouge8/pip that referenced this issue Sep 29, 2015
On versions of CPython affected by <http://bugs.python.org/issue14768>
(Python 2.6, some versions of Python 2.7 and 3.3),
`os.path.expanduser('~/path')` returns `//path` rather than `/path` when
`HOME=/`. This affects pip when `os.path.expanduser('~/.cache/pip')` is
expanded to `/\\\\.cache/pip`. Although `HOME=/` is probably uncommon on
most Linux systems, it is extremely common in Docker images.

Fixes pypa#2996.
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jun 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

No branches or pull requests

2 participants