当前位置:   article > 正文

ConnectionRefusedError: [Errno 111] 拒绝连接_fatal: error [errno 111] connection refused fatal:

fatal: error [errno 111] connection refused fatal: double check your --repo-
  1. pip3 install --upgrade pip
  2. //结果
  3. Exception:
  4. Traceback (most recent call last):
  5. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 138, in _new_conn
  6. (self.host, self.port), self.timeout, **extra_kw)
  7. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/connection.py", line 98, in create_connection
  8. raise err
  9. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/connection.py", line 88, in create_connection
  10. sock.connect(sa)
  11. ConnectionRefusedError: [Errno 111] 拒绝连接
  12. During handling of the above exception, another exception occurred:
  13. Traceback (most recent call last):
  14. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
  15. chunked=chunked)
  16. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 350, in _make_request
  17. self._validate_conn(conn)
  18. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 837, in _validate_conn
  19. conn.connect()
  20. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 281, in connect
  21. conn = self._new_conn()
  22. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 147, in _new_conn
  23. self, "Failed to establish a new connection: %s" % e)
  24. requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f10def4b160>: Failed to establish a new connection: [Errno 111] 拒绝连接
  25. During handling of the above exception, another exception occurred:
  26. Traceback (most recent call last):
  27. File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
  28. status = self.run(options, args)
  29. File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
  30. wb.build(autobuilding=True)
  31. File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
  32. self.requirement_set.prepare_files(self.finder)
  33. File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
  34. ignore_dependencies=self.ignore_dependencies))
  35. File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 487, in _prepare_file
  36. req_to_install, finder)
  37. File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 428, in _check_skip_installed
  38. req_to_install, upgrade_allowed)
  39. File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
  40. all_candidates = self.find_all_candidates(req.name)
  41. File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
  42. for page in self._get_pages(url_locations, project_name):
  43. File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
  44. page = self._get_page(location)
  45. File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
  46. return HTMLPage.get_page(link, session=self.session)
  47. File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
  48. "Cache-Control": "max-age=600",
  49. File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
  50. return self.request('GET', url, **kwargs)
  51. File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
  52. return super(PipSession, self).request(method, url, *args, **kwargs)
  53. File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
  54. resp = self.send(prep, **send_kwargs)
  55. File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
  56. r = adapter.send(request, **kwargs)
  57. File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
  58. resp = super(CacheControlAdapter, self).send(request, **kw)
  59. File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
  60. timeout=timeout
  61. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
  62. _stacktrace=sys.exc_info()[2])
  63. File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
  64. total -= 1
  65. TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'

pip3 install --upgrade pip

//结果
Exception:
Traceback (most recent call last):
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 138, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/connection.py", line 98, in create_connection
    raise err
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/connection.py", line 88, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] 拒绝连接

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
    chunked=chunked)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 350, in _make_request
    self._validate_conn(conn)
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 837, in _validate_conn
    conn.connect()
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 281, in connect
    conn = self._new_conn()
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connection.py", line 147, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
requests.packages.urllib3.exceptions.NewConnectionError: <requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7f10def4b160>: Failed to establish a new connection: [Errno 111] 拒绝连接

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 487, in _prepare_file
    req_to_install, finder)
  File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 428, in _check_skip_installed
    req_to_install, upgrade_allowed)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
    "Cache-Control": "max-age=600",
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
    r = adapter.send(request, **kwargs)
  File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
    timeout=timeout
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
    total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
 

原因,网络连接问题。

解决办法,更换源:

mkdir ~/.pip

cat >~/.pip/pip.conf << EOF
[global]
trusted-host=mirrors.aliyun.com
index-url=http://mirrors.aliyun.com/pypi/simple/
EOF


pip3 install --upgrade pip

  1. mkdir ~/.pip
  2. cat >~/.pip/pip.conf << EOF
  3. [global]
  4. trusted-host=mirrors.aliyun.com
  5. index-url=http://mirrors.aliyun.com/pypi/simple/
  6. EOF
  7. pip3 install --upgrade pip

OK

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/148324?site
推荐阅读
相关标签
  

闽ICP备14008679号