zzmx0

对captcha包下的captcha.py文件做修改如下

一、提示错误

ModuleNotFoundError: No module named \'cStringIO\'

解决办法:

第9行,将’cStringIO’改为’io

 

 二、提示错误:

AttributeError: module \'string\' has no attribute \'uppercase\'
AttributeError: module \'string\' has no attribute \'lowercase\'

解决方法:

71行和208行,将‘uppercase’改为‘ascii_uppercase’,将\'lowercase’改为\'ascii_lowercase’

 

 

 三、提示错误:

TypeError: string argument expected, got \'bytes\'

解决方法:

第9行,首先从’io’模块中导入’BytesIO’

然后在代码210行左右,\'StringIO\'改为\'BytesIO\'

 

四、所有xrange都改为range

五、PIL模块需要安装Pillow:

pip install Pillow

分类:

技术点:

相关文章:

  • 2021-08-04
  • 2021-08-04
  • 2021-08-04
  • 2021-12-15
  • 2021-08-04
  • 2021-08-04
猜你喜欢
  • 2021-08-04
  • 2021-08-04
  • 2021-11-08
  • 2021-08-04
  • 2021-08-04
  • 2021-10-19
相关资源
相似解决方案