windows下用anaconda调试python项目wechat_admin

1、下载:https://github.com/dongweiming/wechat-admin  解压缩

2、管理员模式运行anaconda prompt,cd进入解压后的目录,

3、创建一个运行环境,名字叫py3,conda create -n py3 python=3.5 , 激活 activate py3

4、pip install -r requirements.txt

5、安装MySQL、Redis,然后创建库(默认是test):其中mysql可以用phpstudy2018等套件安装后直接用,记得修改config.py里第五行的mysql连接串。redis下载支持windows的2.6版,解压后直接双击运行redis-server.exe。

6、初始化数据库:

set FLASK_APP=manager.py (注意不要带空格啥的,好敏感)

flask initdb

7、运行

python app.py

系统出现:

(py3) C:\PYTHONCODE\wechat-admin-master>python app.py
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 337-619-503
 * Running on http://0.0.0.0:8100/ (Press CTRL+C to quit)

打开浏览器http://127.0.0.1:8100/,微信扫描二维码

8、另开prompt窗口

celery -A wechat worker --loglevel=info

由于celery 4.0不支持windows系统。所以用命令pip install Celery安装的celery是最新版4.0的不能在windows下运行。

在windows命令窗口运行:

celery -A wechat worker --loglevel=info

将会出现OSError: [WinError 87] 参数错误提示,如下处理:

  1. pip uninstall Celery  
  2. pip install celery==3.1.25  




猜你喜欢

转载自blog.csdn.net/xgocn/article/details/80458226