如何修复“无法找到或加载 Qt 平台插件窗口"在 PyCharm 中使用 Matplotlib 时 [英] How to fix "could not find or load the Qt platform plugin windows" while using Matplotlib in PyCharm

查看:97
本文介绍了如何修复“无法找到或加载 Qt 平台插件窗口"在 PyCharm 中使用 Matplotlib 时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 PyCharm 中使用 matplotlib 时出现错误无法找到或加载 Qt 平台插件窗口".

I am getting the error "could not find or load the Qt platform plugin windows" while using matplotlib in PyCharm.

我该如何解决这个问题?

How can I solve this?

推荐答案

我在 Anaconda3 4.2.0 和 4.3.0.1(64 位)上遇到了同样的问题.当我尝试运行一个使用 matplotlib 的简单程序时,我收到以下错误消息:

I had the same problem with Anaconda3 4.2.0 and 4.3.0.1 (64-bit). When I tried to run a simple program that uses matplotlib, I got this error message:

This application failed to start because it could not find or load the Qt platform plugin "windows"

Reinstalling the application may fix this problem.

重新安装没有修复它.

这有什么帮助(找到 此处):查找 Anaconda 目录并将 Library\plugins 子目录(此处为 c:\ProgramData\Anaconda3\Library\plugins)设置为环境变量 QT_PLUGIN_PATH在控制面板/系统/高级系统设置/环境变量下.

What helped was this (found here): Look for the Anaconda directory and set the Library\plugins subdir (here c:\ProgramData\Anaconda3\Library\plugins) as environment variable QT_PLUGIN_PATH under Control Panel / System / Advanced System Settings / Environment Variables.

设置变量后,如果更改没有立即生效,您可能需要重新启动 PyCharm.

After setting the variable you might need to restart PyCharm, if the change does not have an immediate effect.

即使在命令行 Python 工作之后,TexWorks(也使用 Qt)显示了与它非常相似的错误消息.将 QT_PLUGIN_PATH 设置为包含 TexWorks 的 Qt DLL 的目录(此处为 C:\Users\chris\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64)已修复两个程序的问题.

Even though after that the command line Python worked, TexWorks (which uses Qt as well) displayed an error message very much like it. Setting the QT_PLUGIN_PATH to the directory containing TexWorks' Qt DLLs (here C:\Users\chris\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64) fixed the problem for both programs.

这篇关于如何修复“无法找到或加载 Qt 平台插件窗口"在 PyCharm 中使用 Matplotlib 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆