使用以下的命令行安裝:python
pip install wxpy微信
Collecting wxpy
Downloading https://files.pythonhosted.or...
c4561551489f36/wxpy-0.3.9.8.tar.gz (45kB)app
100% | 51kB 98kB/s
Collecting itchat==1.2.32 (from wxpy)
Downloading https://files.pythonhosted.or...
3fec62ed7bb343/itchat-1.2.32-py2.py3-none-any.whl
Requirement already satisfied: requests in c:myapppy20180816
Requirement already satisfied: future in c:myapppy20180816l
om wxpy) (0.16.0)
Collecting pyqrcode (from itchat==1.2.32->wxpy)
Downloading https://files.pythonhosted.or...
884ac68d979316/PyQRCode-1.2.1.tar.gz
Collecting pypng (from itchat==1.2.32->wxpy)
Downloading https://files.pythonhosted.or...
017663467f5147/pypng-0.0.20.tar.gz (649kB) ui
Requirement already satisfied: certifi>=2017.4.17 in c:myapp\url
wxpy) (2018.8.13)
Requirement already satisfied: chardet<3.1.0,>=3.0.2 in c:mya
ts->wxpy) (3.0.4)
Requirement already satisfied: urllib3<1.24,>=1.21.1 in c:mya
ts->wxpy) (1.23)
在python文件wechat.py裏使用這個庫的時候,若是遇到以下的錯誤消息:ModuleNotFoundError: No module named PILspa
解決方法是安裝pillow這個庫:命令行
pip install pillow3d
若是遇到下面這個超時的錯誤:code
Retrying (Retry(total-1, connect=None, read=None, redirect=None, status-None)) aftery 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out./simple/pillow/blog
能夠使用國內鏡像代替:
由於wxpy這個庫背後其實使用的是微信網頁版的功能,因此若是你的python程序在使用wxpy不能正常工做時,先檢查你的微信帳號是否可以成功登陸微信網頁版,若是遇到下列這種提示,說明你的微信帳號沒法使用wxpy庫。
要獲取更多Jerry的原創文章,請關注公衆號"汪子熙":