gpt4 book ai didi

python - 错误: Failed to enable GUI event loop integration for 'qt' while importing pandas

转载 作者:行者123 更新时间:2023-12-01 03:49:26 25 4
gpt4 key购买 nike

我使用 PyCharm Pro 2016.1.4 和 pandas 18.1。每当我导入 pandas 时,我都会遇到问题。这是在我更新 PyCharm Pro(从 2016.1.3 开始)和 IPython 5 后发生的。

这是当我启动它然后导入 pandas 时控制台显示的内容:

C:\Anaconda2\python.exe "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\pydevconsole.py" 51602 51603
Python 2.7.12 |Anaconda 2.4.1 (64-bit)| (default, Jun 29 2016, 11:42:13) [MSC v.1500 32 bit (Intel)]
Type "copyright", "credits" or "license" for more information.

IPython 4.0.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
PyDev console: using IPython 4.0.1

import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['C:\\Abc\\Dev\\Code\\abc'])

Python 2.7.12 |Anaconda 2.4.1 (64-bit)| (default, Jun 29 2016, 11:42:13) [MSC v.1500 32 bit (Intel)] on win32
In[2]: import pandas
Backend Qt4Agg is interactive backend. Turning interactive mode on.
Failed to enable GUI event loop integration for 'qt'
Traceback (most recent call last):
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\_pydev_bundle\pydev_console_utils.py", line 544, in do_enable_gui
enable_gui(guiname)
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\pydev_ipython\inputhook.py", line 509, in enable_gui
return gui_hook(app)
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\pydev_ipython\inputhook.py", line 194, in enable_qt4
from pydev_ipython.inputhookqt4 import create_inputhook_qt4
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\pydev_ipython\inputhookqt4.py", line 25, in <module>
from pydev_ipython.qt_for_kernel import QtCore, QtGui
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\pydev_ipython\qt_for_kernel.py", line 80, in <module>
QtCore, QtGui, QtSvg, QT_API = load_qt(api_opts)
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\pydev_ipython\qt_loaders.py", line 241, in load_qt
result = loaders[api]()
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\pydev_ipython\qt_loaders.py", line 165, in import_pyqt4
import sip
File "C:\Program Files (x86)\JetBrains\PyCharm 2016.1.4\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: %1 is not a valid Win32 application.

知道出了什么问题吗?谢谢你!

最佳答案

这与 Qt DLL 版本冲突有关。我能够通过这样做让它工作conda更新--全部

这似乎修复了缺失的依赖关系:我在 C:\Anaconda3\Library\bin 和 C:\Anaconda3\Library\lib 中看到了以前不存在的 QtCore4.dll 副本。

根据下面的研究,其他人将 QtCore4.dll、QtGui4.dll 复制到 C:\Anaconda3\Lib\site-packages\PyQt4\bin,或者从环境中删除其他路径

这是一些背景:

Cannot import PyQt4.QtGui

iPython/jupyter qtconsole fails to start in anaconda 2.4.0

PyQt4 Need to move DLLs to package root

https://github.com/ContinuumIO/anaconda-issues/issues/540

关于python - 错误: Failed to enable GUI event loop integration for 'qt' while importing pandas,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38483517/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com