首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Tensorflow中的Python SSL认证问题

Tensorflow中的Python SSL认证问题
EN

Stack Overflow用户
提问于 2017-10-20 23:34:36
回答 2查看 3.3K关注 0票数 7

我正在尝试下载MNIST数据,这些数据应该是在以下文件中处理的:

tensorflow.examples.tutorials.mnist.input_data.read_data_sets()

据我所知,read_data_sets向服务器发送拉请求,以下载1.5GB的数据。

我一直收到这个跟踪错误:

代码语言:javascript
运行
复制
File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py",
line 1318, in do_open
    encode_chunked=req.has_header('Transfer-encoding'))   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py",
line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)   File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py",
line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py",
line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)   File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py",
line 1026, in _send_output
    self.send(msg)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py",
line 964, in send
    self.connect()   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py",
line 1400, in connect
    server_hostname=server_hostname)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py",
line 401, in wrap_socket
    _context=self, _session=session)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py",
line 808, in __init__
    self.do_handshake()   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py",
line 1061, in do_handshake
    self._sslobj.do_handshake()   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py",
line 683, in do_handshake
    self._sslobj.do_handshake() ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:748)

这显然与SSL cert python的使用有关..。因此,我转到/Applications/Python3.6/,执行了位于那里的“InstallyCertifactions.command”,得到了以下错误:

代码语言:javascript
运行
复制
Traceback (most recent call last):   File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/shutil.py",
line 544, in move
    os.rename(src, real_dst) PermissionError: [Errno 13] Permission denied:
'/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/certifi-2015.04.28.dist-info/DESCRIPTION.rst'
-'/var/folders/mq/g_jy_1qx1vjdb3xmdh7y62y80000gn/T/pip-3m8ixnf5-uninstall/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/certifi-2015.04.28.dist-info/DESCRIPTION.rst'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):   File
"/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/basecommand.py",
line 215, in main
    status = self.run(options, args)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/commands/install.py",
line 342, in run
    prefix=options.prefix_path,   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_set.py",
line 778, in install
    requirement.uninstall(auto_confirm=True)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_install.py",
line 754, in uninstall
    paths_to_remove.remove(auto_confirm)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/req/req_uninstall.py",
line 115, in remove
    renames(path, new_path)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/utils/__init__.py",
line 267, in renames
    shutil.move(old, new)   File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/shutil.py",
line 559, in move
    os.unlink(src) PermissionError: [Errno 13] Permission denied: '/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/certifi-2015.04.28.dist-info/DESCRIPTION.rst'

我的文件系统权限有问题吗?一个月前我在这台电脑上重新安装了OSX .

有办法手动安装证书吗?还是发出拉请求将数据下载到非https地址?

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46858630

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档