WinError 193] %1 不是有效的 Win32 应用程序

WinError 193] %1 is not a valid Win32 application

我正在使用 spyder 并尝试将 pandas 导入为 pd,但出现以下错误:

导入 pandas 作为 pd 追溯(最近一次通话最后一次):

文件“”,第 1 行,位于 将 pandas 导入为 pd

文件 "C:\Users\omer qureshi\AppData\Roaming\Python\Python37\site-packages\pandas__init__.py",第 13 行,在 导入(依赖)

文件 "C:\Users\omer qureshi\AppData\Roaming\Python\Python37\site-packages\numpy__init__.py",第 142 行,在 从 。导入核心

文件 "C:\Users\omer qureshi\AppData\Roaming\Python\Python37\site-packages\numpy\core__init__.py",第 23 行,在 WinDLL(os.path.abspath(文件名))

文件 "C:\Users\omer qureshi\Anaconda3\lib\ctypes__init__.py",第 356 行,在 init 中 self._handle = _dlopen(self._name, 模式)

OSError: [WinError 193] %1 不是有效的 Win32 应用程序

谁能解释一下哪里出了问题?

可能发生了另一件事。 VS 代码自动从预定义的 OS 位置搜索 numpy 和其他包。它可能找到了 32 位版本的 numpy 而不是 64 位版本。 要修复此问题,请从所有 OS 位置卸载 numpy。 * 在 VS code terminal 中输入 pip uninstall numpyconda uninstall numpy (如果你使用 Anaconda) * 重启VS代码 *瞧! (如果问题仍然存在,请重新安装 numpy)