无法使用pip3安装DjangoRestFramework?

用户名

我一直在尝试

pip3 install djangorestframework

我一直得到这个结果:

Collecting djangorestframework
Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /simple/djangorestframework/
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /simple/djangorestframework/
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /simple/djangorestframework/
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /simple/djangorestframework/
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /simple/djangorestframework/
  Could not find a version that satisfies the requirement djangorestframework (from versions: )
No matching distribution found for djangorestframework

我正在使用python3,这就是为什么我使用pip3的原因。

编辑只是为了进一步说明...仅在安装和卸载此软件包时发生。我使用pytz进行了测试,可以自由安装和卸载。

另外pip3搜索会引发相同的SSL错误,然后将其吐给我:

Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /pypi
Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /pypi
Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /pypi
Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /pypi
Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),)': /pypi
Exception:
Traceback (most recent call last):
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py", line 346, in _make_request
    self._validate_conn(conn)
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py", line 852, in _validate_conn
    conn.connect()
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connection.py", line 326, in connect
    ssl_context=context)
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/util/ssl_.py", line 329, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
    _context=self, _session=session)
  File "/usr/lib/python3.6/ssl.py", line 817, in __init__
    self.do_handshake()
  File "/usr/lib/python3.6/ssl.py", line 1077, in do_handshake
    self._sslobj.do_handshake()
  File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py", line 668, in urlopen
    **response_kw)
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py", line 668, in urlopen
    **response_kw)
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py", line 668, in urlopen
    **response_kw)
  [Previous line repeated 2 more times]
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/share/python-wheels/urllib3-1.22-py2.py3-none-any.whl/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi (Caused by SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),))

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/search.py", line 45, in run
    pypi_hits = self.search(query, options)
  File "/usr/lib/python3/dist-packages/pip/commands/search.py", line 62, in search
    hits = pypi.search({'name': query, 'summary': query}, 'or')
  File "/usr/lib/python3.6/xmlrpc/client.py", line 1112, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python3.6/xmlrpc/client.py", line 1452, in __request
    verbose=self.__verbose
  File "/usr/lib/python3/dist-packages/pip/download.py", line 775, in request
    headers=headers, stream=True)
  File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/sessions.py", line 567, in post
    return self.request('POST', url, data=data, json=json, **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.18.4-py2.py3-none-any.whl/requests/sessions.py", line 520, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/sessions.py", line 630, 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.18.4-py2.py3-none-any.whl/requests/adapters.py", line 506, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='pypi.python.org', port=443): Max retries exceeded with url: /pypi (Caused by SSLError(SSLError(1, '[SSL: UNEXPECTED_MESSAGE] unexpected message (_ssl.c:852)'),))
阿泽姆

检查DRF的要求

要求

REST框架要求以下内容:

Python(3.5、3.6、3.7)Django(1.11、2.0、2.1、2.2)

我们强烈建议并仅正式支持每个Python和Django系列的最新修补程序版本。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

无法在FreeBSD上使用pip3安装matplotlib

来自分类Dev

无法在MacOS Sierra上使用pip3安装mysqlclient

来自分类Dev

无法在ubantu中安装“ pip3”

来自分类Dev

使用virtualenv安装pip3

来自分类Dev

使用pip3安装JupyterLab

来自分类Dev

如何使用pip3安装scipy?

来自分类Dev

无法为 python3 正确安装 pip3

来自分类Dev

无法在Ubuntu中使用pip3为Django安装mysqlclient

来自分类Dev

Django:如何使用pip3安装mysql / connector python

来自分类Dev

在 Ubuntu 16.04 上使用 pip3 安装的奇怪问题

来自分类Dev

使用 pip3 安装 scikit-learn

来自分类Dev

如何使用 pip3 在 debian 上安装 caffe?

来自分类Dev

debian9无法使用pip3安装python软件包或使用apt卸载软件包

来自分类Dev

使用pip3安装NumPy失败,但是可以使用pip安装

来自分类Dev

迁移到 debian Strech 后无法使用 pip3

来自分类Dev

Pip3安装模块在哪里?

来自分类Dev

从pip3安装软件包

来自分类Dev

用pip3安装软件

来自分类Dev

离线安装python 3.6.7 pip3

来自分类Dev

Python 3.6.2 pip3 安装失败

来自分类Dev

pip3 安装 virtualenv 失败

来自分类Dev

在Debian Linux中安装pip3后无法导入pyperclip

来自分类Dev

即使我安装了pip3,也无法导入NumPy

来自分类Dev

为什么pip3安装软件包无法导入?

来自分类Dev

无法启动与 pip3 一起安装的 ReText - 如何解决?

来自分类Dev

将Numpy和pip3安装在python2.7中时,如何为python3.x安装Numpy和pip3?使用Conda吗?

来自分类Dev

如何从命令行使用已安装的pip3软件包?

来自分类Dev

使用pip3安装python 3.4软件包时出错

来自分类Dev

Ansible 运行分析工具:使用 pip3 安装 mysqlclient 期间出现异常