MPLD3未在浏览器中显示图形

时间:2016-06-20 11:03:12

标签: python python-3.x matplotlib mpld3

我在Mac OS X 10.11.4上使用谷歌浏览器。我试图从mpld3库运行this示例。我读到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的开发者工具也不会报告任何错误。有谁知道问题可能是什么?

0 个答案:

没有答案