How to fix quot;could not find or load the Qt platform plugin windowsquot; while using Matplotlib in PyCharm(如何修复“无法找到或加载 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.
重新安装并没有解决它.
Reinstalling didn't fix it.
这有什么帮助(发现 这里):查找 Anaconda 目录并将 Libraryplugins
子目录(此处为 c:ProgramDataAnaconda3Libraryplugins
)设置为环境变量 QT_PLUGIN_PATH
在控制面板/系统/高级系统设置/环境变量下.
What helped was this (found here):
Look for the Anaconda directory and set the Libraryplugins
subdir (here c:ProgramDataAnaconda3Libraryplugins
) 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:UserschrisAppDataLocalProgramsMiKTeX 2.9miktexinx64
)已修复两个程序的问题.
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:UserschrisAppDataLocalProgramsMiKTeX 2.9miktexinx64
) fixed the problem for both programs.
这篇关于如何修复“无法找到或加载 Qt 平台插件窗口"?在 PyCharm 中使用 Matplotlib 时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何修复“无法找到或加载 Qt 平台插件窗口&qu


基础教程推荐
- Python kivy 入口点 inflateRest2 无法定位 libpng16-16.dll 2022-01-01
- 使用PyInstaller后在Windows中打开可执行文件时出错 2022-01-01
- 用于分类数据的跳跃记号标签 2022-01-01
- Dask.array.套用_沿_轴:由于额外的元素([1]),使用dask.array的每一行作为另一个函数的输入失败 2022-01-01
- 在 Python 中,如果我在一个“with"中返回.块,文件还会关闭吗? 2022-01-01
- 筛选NumPy数组 2022-01-01
- 何时使用 os.name、sys.platform 或 platform.system? 2022-01-01
- 如何让 python 脚本监听来自另一个脚本的输入 2022-01-01
- 如何在海运重新绘制中自定义标题和y标签 2022-01-01
- 线程时出现 msgbox 错误,GUI 块 2022-01-01