我想把 nbviewer 带到我的工作中。因为我无法共享公司数据(放在 github 上),我需要在本地安装 nbviewer。有在 Heroku 上设置的说明,但这对我不起作用。有没有人尝试过这个?甚至值得努力吗?还有其他选择吗?谢谢。
让 nbviewer 在本地计算机上运行的步骤:
Step1:从 github 下载 nbviewer
Step2:从 github下载 nbconvert
Step3:将 nbconvert 内容放入 nbviewer 内的“nbconvert”文件夹中
Step4:获取所需库
easy_install Flask==0.9
easy_install Flask-Markdown
easy_install 请求
easy_install Pygments (python xy自带)
easy_install Markdown==2.2.0
easy_install pylibmc==1.2.3
easy_install tornado
easy_install newrelic (安装可选c扩展失败但是认为这没问题)
easy_install pyzmq(带有python xy)
Step5:编辑 gist.py
注释掉所有这些行:
#from flask.ext.cache import Cache line 17
#from lib.MemcachedMultipart import multipartmemecached line 20
#cache = Cache(app, config=config) line 63
#@cache.cached(5*hours) line 92
#@cache.cached(5*hours) line 107
#@cache.cached(5*hours) line 112
#@cache.cached(5*hours) line 117
#@cache.cached(5*hours) line 122
#@cache.cached(5*hours) line 127
#@cache.cached(1*minutes) line 133
#@cache.memoize() line 177
#@cache.memoize(10*minutes) line 201
Step6:运行 app.py
Step7:到 localhost:5000
如何处理身份验证问题?(笔记本位于受密码保护的存储库中)
错误:请求失败:GET http svn/BizIntel/Trunk/notebook.ipynb:需要 401 授权
答案:http 用户名:password@svn/BizIntel/Trunk/notebook.ipynb
请享用!