2017-10-20 146 views
0
Python的SSL認證問題

我試圖下載這是在所謂處理的數據MNIST:在Tensorflow

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

至於我m知道read_data_sets向服務器發送拉取請求以下載(大約)1.5GB數據。

我不斷收到此錯誤回溯:

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證書Python使用......讓我去/應用/ Python的3.6 /並執行「安裝Certifactions。命令「位於那裏,並得到這個錯誤:

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地址?

+0

UPDATE:我能夠手動從Yann Lecun的網站下載文件並將它們放在正確的目錄中。計劃現在正在開展工作,但仍然想要深入瞭解這一點。 –

回答