allan.simon
allan.simon

Reputation: 4316

urllib2.HTTPError: HTTP Error 403: SSL is required , even with pip upgraded and --index option used

I've already read Cannot install distribute: pypi.python.org rejecting http and Getting error 403 while installing package with pip but the work around are not workig

while trying to do

pip install --upgrade pyls --index-url=https://pypi.python.org/simple I got :

Collecting pyls
  Using cached pyls-0.1.3.zip
    Complete output from command python setup.py egg_info:
    Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.14.tar.gz
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-PHBndM/pyls/setup.py", line 31, in <module>
        main()
      File "/tmp/pip-build-PHBndM/pyls/setup.py", line 11, in main
        distribute_setup.use_setuptools()
      File "setup_utils/distribute_setup.py", line 145, in use_setuptools
        return _do_download(version, download_base, to_dir, download_delay)
      File "setup_utils/distribute_setup.py", line 124, in _do_download
        to_dir, download_delay)
      File "setup_utils/distribute_setup.py", line 193, in download_setuptools
        src = urlopen(url)
      File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
        return opener.open(url, data, timeout)
      File "/usr/lib/python2.7/urllib2.py", line 435, in open
        response = meth(req, response)
      File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
        'http', request, response, code, msg, hdrs)
      File "/usr/lib/python2.7/urllib2.py", line 473, in error
        return self._call_chain(*args)
      File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
        result = func(*args)
      File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
        raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    urllib2.HTTPError: HTTP Error 403: SSL is required
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-hdpX4y/pyls/

my python version is 2.7, and my pip version is

pip 9.0.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)

to reproduce :

spin this docker instance https://hub.docker.com/r/allansimon/allan-docker-dev-python and launch the command in it (with user vagrant )

Upvotes: 6

Views: 21155

Answers (4)

Jerry Heo
Jerry Heo

Reputation: 21

In case this might help anyone else...I ran into this issue recently and resolved it by simply updating the pip installer to the latest version:

pip install -U pip

Upvotes: 1

John Jiang
John Jiang

Reputation: 955

I encountered similar issue when jython executing ez_setup.py. It turns out I just had to replace http with https in one of the urls in the script.

Upvotes: 1

RyanCu
RyanCu

Reputation: 566

I was also attempting to upgrade pyls instead of python-language-server and I hit the same error. Doing this instead worked for me:

pip install --upgrade python-language-server

Source: https://github.com/palantir/python-language-server/issues/395

Upvotes: 0

Mr Singh
Mr Singh

Reputation: 4230

I tried it worked for me:

pip install --upgrade pyls -i https://pypi.python.org/simple

Upvotes: -1

Related Questions