Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

FTP download install failed #1532

Closed
lucmult opened this Issue · 12 comments

6 participants

lucmult Simon Kennedy Piotr Dobrogost Donald Stufft Paul Moore Marcus Smith
lucmult
(venv)ubuntu@box31:~/bex$ pip install ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.9.tar.gz
Downloading/unpacking ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.9.tar.gz
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/commands/install.py", line 274, in run
    requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/req.py", line 1173, in prepare_files
    self.unpack_url(url, location, self.is_download)
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/req.py", line 1320, in unpack_url
    retval = unpack_http_url(link, location, self.download_cache, self.download_dir, self.session)
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/download.py", line 555, in unpack_http_url
    resp = session.get(target_url, stream=True)
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 395, in get
    return self.request('GET', url, **kwargs)
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/download.py", line 237, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 383, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 481, in send
    adapter = self.get_adapter(url=request.url)
  File "/home/ubuntu/bex/venv/local/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 526, in get_adapter
    raise InvalidSchema("No connection adapters were found for '%s'" % url)
InvalidSchema: No connection adapters were found for 'ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.9.tar.gz'

Storing debug log for failure in /home/ubuntu/.pip/pip.log
lucmult

pip --version

pip 1.5.2 from /home/ubuntu/bex/venv/local/lib/python2.7/site-packages (python 2.7)
lucmult

I tried the same file using the master HEAD and got the same issue.

lucmult

It works with pip 1.4.1

lucmult

Ok, using git bisect I found this commit introduced the issue:
ff2854a

I'm running the test like:

python pip/runner.py install ftp://xmlsoft.org/libxml2/python/libxml2-python-2.6.9.tar.gz
Simon Kennedy

The looks like it's the result of switching from using the urllib2 library (CacheFTPHandler) to the Requests library which does not provide an FTP Adapter. Until that is available you'll have this problem.

Piotr Dobrogost

@lucmult You can edit your comments – no need to put each update on it's own :)

Donald Stufft
Owner

Hmm, yes this was a result of the switch to requests. However I'm not sure we should continue to support use of ftp urls either way. As far as I'm aware ftp servers to not generally support TLS and without that we lose the ability to securely fetch files from these servers.

Donald Stufft
Owner

Any thoughts @qwcode and @pfmoore ?

Paul Moore
Owner

Personally, I have no need for ftp. The OP's use case is real, though - xmlsoft.org does only distribute libxml2-python over ftp. But that is a very old version - it's from 2004 as far as I can see.

So I don't have any strong objection to simply documenting that ftp support was discontinued with the move to requests. But if people come up with other genuine use cases, we should be prepared to reconsider (I have had ISPs in the past who only supported ftp hosting, and I can imagine having waned to host packages there)

lucmult

I found an alternative HTTP link for this package:
http://xmlsoft.org/sources/python/libxml2-python-2.6.9.tar.gz

HTTP isn't secure either ;-)

Donald Stufft
Owner

Nope! It's not. But HTTPS is and pip is discouraging the use of HTTP instead of HTTPS :)

lucmult

@dstufft many hosts out there don't support HTTPS. In fact, this libxml example doesn't support HTTPS.

I agree with @pfmoore suggestion to "fix" this issue by documenting it.

Marcus Smith qwcode added the docs label
Donald Stufft dstufft added this to the 1.6 milestone
Donald Stufft dstufft closed this in #2133
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.