OSError: [WinError -2147221003] 找不到应用程序: 'QR.png'   原因:  缺少在windows 下相关处理方法  

解决方法:找到你运行环境C:\Python36\Lib\site-packages\itchat

打开utils修改此函数
def print_qr(fileDir):    if config.OS == 'Darwin':        subprocess.call(['open', fileDir])    elif config.OS == 'Linux':        subprocess.call(['xdg-open', fileDir])    else:        os.startfile(fileDir)

修改后import webbrowser
def print_qr(fileDir):    if config.OS == 'Darwin':        subprocess.call(['open', fileDir])    elif config.OS == 'Linux':        subprocess.call(['xdg-open', fileDir])    elif config.OS =='Windows':        webbrowser.open(fileDir)     或
        chrome_path = r'C:\Users\Administrator\AppData\Local\Google\Chrome\Application\chrome.exe'        webbrowser.register('chrome',None,webbrowser.BackgroundBrowser(chrome_path))        webbrowser.get('chrome').open_new_tab(fileDir)
    else:        os.startfile(fileDir)

itchat 报错 OSError: [WinError -2147221003] 找不到应用程序: 'QR.png'的更多相关文章

  1. pandas.read_csv() 报错 OSError: Initializing from file failed,报错原因分析和解决方法

    今天调用pandas读取csv文件时,突然报错“ OSError: Initializing from file failed ”,我是有点奇怪的,以前用的好好的,read_csv(path)方法不是 ...

  2. win2012R2 的IIS报错HTTP404,报错在计算机上找不到服务W3SVC等等

    一.背景 今天远程给客户解决IIS的默认网页浏览找不到文件夹,报错HTTP404,找了很多原因,而且也报错在计算机上找不到服务W3SVC等等,如图所示: 二.原因 试了很多方法都不可以重装IIS都不行 ...

  3. captcha库报错"OSError: cannot open resource"

    问题描述 在win平台上python虚拟环境下使用captcha库生成验证码报错OSError: cannot open resource 代码 from captcha.image import I ...

  4. Python创建文件报错OSError:[Errno 22] Invalid argument处理

    问题: windows平台下使用python open函数w模式打开文件报错“OSError: [Errno 22] Invalid argument: '../news/“消费升维”成零售业新风口? ...

  5. 之前的Android项目报错,新建Android项目报错,代码中找不到错误解决方案

    打开一年前的东西,结果发现里面的android项目全部有个红叉,也找不到错误.新建一个项目也报错,首先确定自己的环境应该没问题,然后通过查看网上的资料,发现可能是debug的keystore到期啦. ...

  6. pip 安装mysqlclient报错OSError: mysql_config not found

    执行 pip install mysqlclient 报错信息如下: [root@CentOS7-demo bin]# pip install mysqlclient Collecting mysql ...

  7. [Error]Python虚拟环境报错 OSError: setuptools pip wheel failed with error code 2

    mkvirtualenv py35 python新建虚拟环境报错,setuptools pip wheel failed with error code 2 刚好昨天在CentOS安装的时候也总是报s ...

  8. selenium webdriver报错 ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

    昨天跑的好好的代码,今天突然报错: ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接. 调查一下,原来是Chrome自动升级,而chrom ...

  9. Windows下安装Tensorflow报错 “DLL load failed:找不到指定的模块"

    Windows下安装完tensorflow后,在cmd下运行python后import tensorflow出现如下错误: Traceback (most recent call last):  Fi ...

随机推荐

  1. Promise的一点感悟~

    在什么大环境下? 今天要讨论的Promise,是js的同步|异步任务的概念下出来的 什么是同步?什么是异步? 我的理解: 一件事情Q 分三部分:Q1 ,  Q2  ,  Q3 同步方式完成: Q1 - ...

  2. 配置samba的流程

    1.关闭防火墙和selinuxservice iptables stopsetenforce 02.配置本地yummount /dev/cdrom /mediacd /etc/yum.repos.dc ...

  3. Winform 弹出窗体等待

    显示效果: FrmWaiting.cs: public FrmWaitingBox(EventHandler<EventArgs> Method,string msg) { Initial ...

  4. hadoop单机模式安装流程

    这里的安装是在Linux系统上安装的 参考博客 : https://blog.csdn.net/cafebar123/article/details/73500014 https://blog.csd ...

  5. 【亲测可用网上的不靠谱居多】一个完整的用canvas画内容然后保存到本地的例子

    涉及好多个问题 比如保存到本地有黑色背景 怎么用把文字和图 画到画布上 腾讯的东西就是坑多了 直接上代码吧 啥也不说额 pic.wxml <view class='container'> ...

  6. tomcat启动时错误:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].错误

    今天第一次遇到Failed to start component [StandardEngine[Catalina].StandardHost[localhost].错误,并且在错误提示的后半段出现了 ...

  7. 菜鸟教程之学习Shell script笔记(下)

    菜鸟教程Shell script学习笔记(下) 以下内容是学习菜鸟教程之shell教程,所整理的笔记 菜鸟教程之shell教程:http://www.runoob.com/linux/linux-sh ...

  8. pgadmin连接 postgresql远程设置

    背景:通过yum默认方式将pgsql10安装在centos7, pgsql 的配置文件在:/var/lib/pgsql/10/data. 配置文件:postgresql.conf 和 pg_hba.c ...

  9. session的处理机制

    https://blog.csdn.net/deepwishly/article/details/6659613 https://blog.csdn.net/dz45693/article/detai ...

  10. linux光标操作

    看一个真正的专家操作命令行绝对是一种很好的体验-光标在单词之间来回穿梭,命令行不同的滚动. 在这里强烈建立适应GUI节目的开发者尝试一下在提示符下面工作. 但是事情也不是那么简单,还是需要知道“如何去 ...