我在 Mac OS X 10.11.4 上使用 Google Chrome。我试图从库中运行这个示例。mpld3
我读到这mpld3
在 python 3.5 上不起作用,
该
mpld3
项目与 Python 2.6-2.7 和 3.3-3.4 兼容。
所以我使用以下方法创建了一个 3.4 环境:
conda create -n py34 python=3.4 anaconda
运行脚本时出现以下错误:
Exception happened during processing of request from ('127.0.0.1', 52484)
Traceback (most recent call last):
File "/Users/Neill/anaconda/envs/py34/lib/python3.4/socketserver.py", line 305, in _handle_request_noblock
self.process_request(request, client_address)
File "/Users/Neill/anaconda/envs/py34/lib/python3.4/socketserver.py", line 331, in process_request
self.finish_request(request, client_address)
File "/Users/Neill/anaconda/envs/py34/lib/python3.4/socketserver.py", line 344, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/Users/Neill/anaconda/envs/py34/lib/python3.4/socketserver.py", line 673, in __init__
self.handle()
File "/Users/Neill/anaconda/envs/py34/lib/python3.4/http/server.py", line 401, in handle
self.handle_one_request()
File "/Users/Neill/anaconda/envs/py34/lib/python3.4/http/server.py", line 389, in handle_one_request
method()
File "/Users/Neill/anaconda/envs/py34/lib/python3.4/site-packages/mpld3/_server.py", line 38, in do_GET
self.wfile.write("<html><head>"
File "/Users/Neill/anaconda/envs/py34/lib/python3.4/socket.py", line 398, in write
return self._sock.send(b)
TypeError: 'str' does not support the buffer interface
我还确保mpld3
安装了最新版本的。然后本地服务器显示一个空白页面。Chrome 的开发者工具也没有报告错误。有谁知道问题可能是什么?