一、搭建环境
1、安装pip命令
-
在https://pypi.python.org/pypi/pip#downloads 下载pip包解压到一个文件夹,用CMD控制台进入解压目录,输入: python setup.py install(备注:前提是安装Python,并且添加环境变量)
-
加入环境变量path, C:\Python34\Scripts;(Python安装目录)
(备注:相同的path变量名,各个值之间用(;)隔开就行)
2、导入itchat
具体操作操作参考:https://blog.youkuaiyun.com/suki570/article/details/80715981
3、直接通过pycharm安装:pycharm导入python需要的包
https://jingyan.baidu.com/article/93f9803f5dababe0e46f55fc.html
二、遇到的问题
1、no python interpreter configured for the project
解决办法:setting >project Interpreter>Python Interpreter 点击“+”号选择系统安装的Python
三、小程序
import itchat
itchat.auto_login()
itchat.send('Hello, filehelper', toUserName='filehelper')