Error in pip: unsupported operand type(s) for -=: 'Retry' and 'int'












3















I'm trying install the requests, but I can't do that. I'm using Ubuntu 16.04



I tried to install using



$ sudo pip install requests


and I get the following error



Collecting requests
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 512, in _prepare_file
finder, self.upgrade, require_hashes)
File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 273, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 442, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 400, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 545, in _get_pages
page = self._get_page(location)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 648, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python2.7/dist-packages/pip/index.py", line 757, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 378, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 597, in send
history = [resp for resp in gen] if allow_redirects else
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 195, in resolve_redirects
**adapter_kwargs
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'


My python version is the 2.7
and the pip is 8.1.1










share|improve this question





























    3















    I'm trying install the requests, but I can't do that. I'm using Ubuntu 16.04



    I tried to install using



    $ sudo pip install requests


    and I get the following error



    Collecting requests
    Exception:
    Traceback (most recent call last):
    File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
    status = self.run(options, args)
    File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
    requirement_set.prepare_files(finder)
    File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
    File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 512, in _prepare_file
    finder, self.upgrade, require_hashes)
    File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 273, in populate_link
    self.link = finder.find_requirement(self, upgrade)
    File "/usr/lib/python2.7/dist-packages/pip/index.py", line 442, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
    File "/usr/lib/python2.7/dist-packages/pip/index.py", line 400, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
    File "/usr/lib/python2.7/dist-packages/pip/index.py", line 545, in _get_pages
    page = self._get_page(location)
    File "/usr/lib/python2.7/dist-packages/pip/index.py", line 648, in _get_page
    return HTMLPage.get_page(link, session=self.session)
    File "/usr/lib/python2.7/dist-packages/pip/index.py", line 757, in get_page
    "Cache-Control": "max-age=600",
    File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in get
    return self.request('GET', url, **kwargs)
    File "/usr/lib/python2.7/dist-packages/pip/download.py", line 378, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
    File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in request
    resp = self.send(prep, **send_kwargs)
    File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 597, in send
    history = [resp for resp in gen] if allow_redirects else
    File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 195, in resolve_redirects
    **adapter_kwargs
    File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in send
    r = adapter.send(request, **kwargs)
    File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
    File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in send
    timeout=timeout
    File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen
    _stacktrace=sys.exc_info()[2])
    File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment
    total -= 1
    TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'


    My python version is the 2.7
    and the pip is 8.1.1










    share|improve this question



























      3












      3








      3








      I'm trying install the requests, but I can't do that. I'm using Ubuntu 16.04



      I tried to install using



      $ sudo pip install requests


      and I get the following error



      Collecting requests
      Exception:
      Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
      status = self.run(options, args)
      File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
      requirement_set.prepare_files(finder)
      File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
      ignore_dependencies=self.ignore_dependencies))
      File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 512, in _prepare_file
      finder, self.upgrade, require_hashes)
      File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 273, in populate_link
      self.link = finder.find_requirement(self, upgrade)
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 442, in find_requirement
      all_candidates = self.find_all_candidates(req.name)
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 400, in find_all_candidates
      for page in self._get_pages(url_locations, project_name):
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 545, in _get_pages
      page = self._get_page(location)
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 648, in _get_page
      return HTMLPage.get_page(link, session=self.session)
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 757, in get_page
      "Cache-Control": "max-age=600",
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in get
      return self.request('GET', url, **kwargs)
      File "/usr/lib/python2.7/dist-packages/pip/download.py", line 378, in request
      return super(PipSession, self).request(method, url, *args, **kwargs)
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in request
      resp = self.send(prep, **send_kwargs)
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 597, in send
      history = [resp for resp in gen] if allow_redirects else
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 195, in resolve_redirects
      **adapter_kwargs
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in send
      r = adapter.send(request, **kwargs)
      File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in send
      resp = super(CacheControlAdapter, self).send(request, **kw)
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in send
      timeout=timeout
      File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen
      _stacktrace=sys.exc_info()[2])
      File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment
      total -= 1
      TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'


      My python version is the 2.7
      and the pip is 8.1.1










      share|improve this question
















      I'm trying install the requests, but I can't do that. I'm using Ubuntu 16.04



      I tried to install using



      $ sudo pip install requests


      and I get the following error



      Collecting requests
      Exception:
      Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
      status = self.run(options, args)
      File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
      requirement_set.prepare_files(finder)
      File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
      ignore_dependencies=self.ignore_dependencies))
      File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 512, in _prepare_file
      finder, self.upgrade, require_hashes)
      File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 273, in populate_link
      self.link = finder.find_requirement(self, upgrade)
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 442, in find_requirement
      all_candidates = self.find_all_candidates(req.name)
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 400, in find_all_candidates
      for page in self._get_pages(url_locations, project_name):
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 545, in _get_pages
      page = self._get_page(location)
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 648, in _get_page
      return HTMLPage.get_page(link, session=self.session)
      File "/usr/lib/python2.7/dist-packages/pip/index.py", line 757, in get_page
      "Cache-Control": "max-age=600",
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 480, in get
      return self.request('GET', url, **kwargs)
      File "/usr/lib/python2.7/dist-packages/pip/download.py", line 378, in request
      return super(PipSession, self).request(method, url, *args, **kwargs)
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 468, in request
      resp = self.send(prep, **send_kwargs)
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 597, in send
      history = [resp for resp in gen] if allow_redirects else
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 195, in resolve_redirects
      **adapter_kwargs
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/sessions.py", line 576, in send
      r = adapter.send(request, **kwargs)
      File "/usr/share/python-wheels/CacheControl-0.11.5-py2.py3-none-any.whl/cachecontrol/adapter.py", line 46, in send
      resp = super(CacheControlAdapter, self).send(request, **kw)
      File "/usr/share/python-wheels/requests-2.9.1-py2.py3-none-any.whl/requests/adapters.py", line 376, in send
      timeout=timeout
      File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 610, in urlopen
      _stacktrace=sys.exc_info()[2])
      File "/usr/share/python-wheels/urllib3-1.13.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 228, in increment
      total -= 1
      TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'


      My python version is the 2.7
      and the pip is 8.1.1







      14.04 python pip






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 16 '18 at 19:26









      Kulfy

      4,64151642




      4,64151642










      asked Dec 16 '18 at 18:40









      GuilhermeGuilherme

      617




      617






















          1 Answer
          1






          active

          oldest

          votes


















          4














          I fixed that problem on my own. I just reinstalled the pip.



          First of all I uninstalled the pip



          sudo apt-get remove --purge python-pip
          sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get clean
          sudo apt-get update


          after that I just reinstalled the pip



          sudo apt-get install python-pip
          sudo pip install requests


          and it works.






          share|improve this answer


























          • This seems a bit intense. Maybe just sudo apt-get install --reinstall python-pip would have worked

            – wjandrea
            Dec 16 '18 at 20:39











          • i tried but I didn't work ...

            – Guilherme
            Dec 17 '18 at 2:01











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1102387%2ferror-in-pip-unsupported-operand-types-for-retry-and-int%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          I fixed that problem on my own. I just reinstalled the pip.



          First of all I uninstalled the pip



          sudo apt-get remove --purge python-pip
          sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get clean
          sudo apt-get update


          after that I just reinstalled the pip



          sudo apt-get install python-pip
          sudo pip install requests


          and it works.






          share|improve this answer


























          • This seems a bit intense. Maybe just sudo apt-get install --reinstall python-pip would have worked

            – wjandrea
            Dec 16 '18 at 20:39











          • i tried but I didn't work ...

            – Guilherme
            Dec 17 '18 at 2:01
















          4














          I fixed that problem on my own. I just reinstalled the pip.



          First of all I uninstalled the pip



          sudo apt-get remove --purge python-pip
          sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get clean
          sudo apt-get update


          after that I just reinstalled the pip



          sudo apt-get install python-pip
          sudo pip install requests


          and it works.






          share|improve this answer


























          • This seems a bit intense. Maybe just sudo apt-get install --reinstall python-pip would have worked

            – wjandrea
            Dec 16 '18 at 20:39











          • i tried but I didn't work ...

            – Guilherme
            Dec 17 '18 at 2:01














          4












          4








          4







          I fixed that problem on my own. I just reinstalled the pip.



          First of all I uninstalled the pip



          sudo apt-get remove --purge python-pip
          sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get clean
          sudo apt-get update


          after that I just reinstalled the pip



          sudo apt-get install python-pip
          sudo pip install requests


          and it works.






          share|improve this answer















          I fixed that problem on my own. I just reinstalled the pip.



          First of all I uninstalled the pip



          sudo apt-get remove --purge python-pip
          sudo apt-get autoremove && sudo apt-get autoclean && sudo apt-get clean
          sudo apt-get update


          after that I just reinstalled the pip



          sudo apt-get install python-pip
          sudo pip install requests


          and it works.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Dec 16 '18 at 19:14









          Kulfy

          4,64151642




          4,64151642










          answered Dec 16 '18 at 19:13









          GuilhermeGuilherme

          617




          617













          • This seems a bit intense. Maybe just sudo apt-get install --reinstall python-pip would have worked

            – wjandrea
            Dec 16 '18 at 20:39











          • i tried but I didn't work ...

            – Guilherme
            Dec 17 '18 at 2:01



















          • This seems a bit intense. Maybe just sudo apt-get install --reinstall python-pip would have worked

            – wjandrea
            Dec 16 '18 at 20:39











          • i tried but I didn't work ...

            – Guilherme
            Dec 17 '18 at 2:01

















          This seems a bit intense. Maybe just sudo apt-get install --reinstall python-pip would have worked

          – wjandrea
          Dec 16 '18 at 20:39





          This seems a bit intense. Maybe just sudo apt-get install --reinstall python-pip would have worked

          – wjandrea
          Dec 16 '18 at 20:39













          i tried but I didn't work ...

          – Guilherme
          Dec 17 '18 at 2:01





          i tried but I didn't work ...

          – Guilherme
          Dec 17 '18 at 2:01


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1102387%2ferror-in-pip-unsupported-operand-types-for-retry-and-int%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Wiesbaden

          Marschland

          Dieringhausen