程序运行时提示This application failed to start because no Qt platform plugin could be initialized.

15 篇文章 2 订阅

包含QT的程序,运行的时候可能会遇到This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.Reinstarlling...这个报错。

大致意思就是qt平台插件初始化失败了。如图:

å¨è¿éæå¥å¾çæè¿°

解决办法:

你的电脑上如果没有qt5的库,可以从这里下载QT5库.zip · juhua/qt5通过vcpkg编译好的dll - Gitee.com, qt5的库里包含的有个plugins文件夹,点开之后里面是bearer、iconengines、imageformats、platforms等等这些目录。如图:

找不到的建议直接everything工具搜索。找到之后将这个plugins直接复制到你的可执行程序目录下,如图:

再次运行程序,正常运行,不再报上述QT的错误。

  • 13
    点赞
  • 63
    收藏
    觉得还不错? 一键收藏
  • 21
    评论
出"This application failed to start because no Qt platform plugin could be initialized"错误是因为在pycharm运行程序时缺少Qt平台插件的库文件。这个错误通常发生在缺少xcb库文件或者没有正确配置Qt平台插件路径的情况下。 解决这个问题的方法是确保正确安装了Qt平台插件,并将插件路径配置到环境变量中。 首先,你可以尝试重新安装应用程序,这可能会修复问题。如果问题仍然存在,可以按照以下步骤解决问题: 1. 找到你的Qt平台插件的路径,通常是在你的pycharm安装目录下的qt/plugins文件夹中。 2. 打开pycharm,点击"File",然后选择"Settings"。 3. 在"Settings"窗口中,选择"Build, Execution, Deployment",然后选择"Python Interpreter"。 4. 在"Python Interpreter"页签中,选择你的项目的解释器。 5. 在右侧的"Environment"字段中,点击编辑按钮。 6. 在编辑环境变量的对话框中,添加一个新的环境变量,名称为"QT_QPA_PLATFORM_PLUGIN_PATH",值为Qt平台插件的路径。 7. 点击确定保存更改。 现在,重新运行程序,应该就能够正常启动了。如果问题仍然存在,可能是由于其他问题引起的,你可以尝试重新安装Qt和pycharm,或者在开发环境中查找其他解决方案。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [This application failed to start because no Qt platform plugin could be initialized. Reinstalling th](https://blog.csdn.net/weixin_45297905/article/details/127703251)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [成功解决This application failed to start because no Qt platform plugin could be initialized.](https://blog.csdn.net/weixin_62087061/article/details/128910228)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值