我想用caffe.drawmac在anaconda python上绘制caffe网.但是我得到了这样的错误:
File "python/draw_net.py", line 45, in <module>
main()
File "python/draw_net.py", line 41, in main
caffe.draw.draw_net_to_file(net, args.output_image_file, args.rankdir)
File "/Users/xxh/caffe/distribute/python/caffe/draw.py", line 222, in draw_net_to_file
fid.write(draw_net(caffe_net, rankdir, ext))
File "/Users/xxh/caffe/distribute/python/caffe/draw.py", line 204, in draw_net
return get_pydot_graph(caffe_net, rankdir).create(format=ext)
File "/Users/xxh/anaconda2/lib/python2.7/site-packages/pydot.py", line 1883, in create
prog=prog))
Exception: "dot" not found in path.
Run Code Online (Sandbox Code Playgroud)
我已经安装了pydot和graphviz,我怎样才能将dot的路径添加到python路径?
我在 mac 上安装了 anaconda 而不是系统的 python,但是当我输入时
import wx
app = wx.App()
Run Code Online (Sandbox Code Playgroud)
我懂了:
该程序需要访问屏幕。请使用 Python 的框架版本运行,并且仅当您在 Mac 的主显示屏上登录时才运行。
我使用脚本:
#!/bin/bash
# what real Python executable to use
PYVER=2.7
PYTHON=/Library/Frameworks/Python.framework/Versions/$PYVER/bin/python$PYVER
# find the root of the virtualenv, it should be the parent of the dir this script is in
ENV=`$PYTHON -c "import os; print os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..'))"`
# now run Python with the virtualenv set as Python's HOME
export PYTHONHOME=$ENV
exec $PYTHON "$@"
Run Code Online (Sandbox Code Playgroud)
但它只是使用系统python。不能在anaconda中使用lib。我想在anaconda中使用wx GUI,如何解决问题?
我是flask 的新手。我用flask+gunicorn 配置了一个服务器。
代码文件test.py是这样调用的:
from flask import Flask
app = Flask(__name__)
@app.route('/')
def test():
return aa+"world!"
if __name__ == '__main__':
aa = "hello"
app.run()
Run Code Online (Sandbox Code Playgroud)
运行它使用?gunicorn -b 0.0.0.0:8080 test:app
我弄错了?NameError: name 'aa' is not defined.
我想要一些代码,比如aa在 gunicorn 之前运行变量。
怎么做?