1 安装visdom
pip install visdom
2 启动vidom
python -m visdom.server
如果此时卡在downloading
(1) C:\Python3.6\Lib\site-packages\visdom\server.py 在download_scripts()添加打印下载所需文件的代码
记录需要下载的文件如下:
https://unpkg.com/jquery@3.1.1/dist/jquery.min.js
https://unpkg.com/bootstrap@3.3.7/dist/js/bootstrap.min.js
https://unpkg.com/react@16.2.0/umd/react.production.min.js
https://unpkg.com/react-dom@16.2.0/umd/react-dom.production.min.js
https://unpkg.com/react-modal@3.1.10/dist/react-modal.min.js
https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_SVG
https://cdn.plot.ly/plotly-latest.min.js
https://unpkg.com/sjcl@1.0.7/sjcl.js
https://unpkg.com/react-resizable@1.4.6/css/styles.css
https://unpkg.com/react-grid-layout@0.16.3/css/styles.css
https://unpkg.com/bootstrap@3.3.7/dist/css/bootstrap.min.css
https://unpkg.com/classnames@2.2.5
https://unpkg.com/layout-bin-packer@1.4.0/dist/layout-bin-packer.js
https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.eot
https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.woff2
https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.woff
https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.ttf
https://unpkg.com/bootstrap@3.3.7/dist/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular
使用迅雷下载下文件后按照 download_scripts()函数要求改的名字,把下载的文件改成正确的名字,代码中冒号后面的名字
把文件拷贝到C:\Python3.6\Lib\site-packages\visdom的static文件夹下
(2)注释掉C:\Python3.6\Lib\site-packages\visdom\server.py 文件下的 download_scripts(),并在如下图
3 python -m visdom.server 再次启动
在浏览器输入http://localhost:8097/ 访问
4 或者修改server.py的下载代码,将request.Request修改为下面的方式
from six.moves.urllib import request
request.urlretrieve("https://unpkg.com/bootstrap@3.3.7/dist/css/bootstrap.min.css","D:/xx.css")