Python问题记录


用的是Windows的python3.7.0 64的IDLE,记录学习Python过程中碰到的每个问题,持续更新~

【1】20190428_安装itchat失败

itchat用于爬微信,直接cmd中pip install itchat失败。
解决办法:

C:\Users\13183>D:
D:>cd D:\2-instsall\Python\Python37\Scripts
D:\2-instsall\Python\Python37\Scripts>pip install itchat

【2】20190428_OSError: cannot write mode RGBA as JPEG

因为RGBA的Alpha指透明度,jpg不支持,可以保存为.png文件,也可以舍弃透明度。

p=p.convert('RGB')
p.save('1.jpg')

要不是记录下来,我就忽略这第二个方法啦~

【3】20190429_itchat每次要扫描二维码登陆

要加上hotReload=True:

itchat.auto_login(hotReload=True)

【4】20190429_UnicodeEncodeError: ‘UCS-2’ codec can’t encode characters in position 1-1: Non-BMP character not supported in Tk

这个错误因为包含特殊字符(name),添加:

import sys
non_bmp_map = dict.fromkeys(range(0x10000, sys.maxunicode + 1),> 0xfffd)
name=name.translate(non_bmp_map)

【5】20190429_图像识别Tesseract-OCR

【 5.1】tesseract is not installed or it’s not in your path

PIL已安装,安装tesseract-ocr-setup-4.00.00dev.exe:

pip install pytesser3
pip install pytesseract
下载tesseract-ocr-setup-4.00.00dev.exe安装。安装

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值