6

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 )

allan.simon
  • 3,886
  • 6
  • 35
  • 60
  • Are You Getting error in terminal:- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-3LYGHv/pyls/ – Mr Singh Mar 17 '18 at 10:13
  • @DeependraSingh yes, i edited the output , i missed these two lines while copy pasting – allan.simon Mar 17 '18 at 10:30

4 Answers4

1

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.

John Jiang
  • 827
  • 1
  • 9
  • 19
1

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
Jerry Heo
  • 21
  • 1
0

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

RyanCu
  • 516
  • 4
  • 12
-1

I tried it worked for me:

pip install --upgrade pyls -i https://pypi.python.org/simple
ddaa
  • 52,890
  • 7
  • 50
  • 59
Mr Singh
  • 3,936
  • 5
  • 41
  • 60
  • 1
    doing this command gives me: Cannot unpack file /tmp/pip-z9patb-unpack/simple (downloaded from /tmp/pip-bTRFoA-build, content-type: text/html; charset=utf-8); cannot detect archive format as if it was trying to install the "simple" package – allan.simon Mar 17 '18 at 10:31
  • 1
    There is a '-i' missing before https://pypi.python.org/simple. The full command should be `pip install --upgrade pyls -i https://pypi.python.org/simple` – Simon Kohlmeyer Mar 22 '18 at 10:05