使用pip install安装 pandas 并尝试使用 IntelliJ
导入 pandas 时,出现此错误C:\Users\Start\venv\Pyhon3.7\Scripts\python.exe D:/PYTHON/HelloWorld/HelloWorld.py Traceback (most recent call last): File "C:\Users\Start\venv\Pyhon3.7\lib\site-packages\pandas\__init__.py", line 30, in <module> from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib File "pandas\_libs\hashtable.pyx", line 1, in init pandas._libs.hashtable ImportError: DLL load failed: %1 is not a valid Win32 application.
在处理上述异常期间,发生了另一个异常:
Traceback (most recent call last): File "D:/PYTHON/HelloWorld/HelloWorld.py", line 25, in <module> import pandas as pd File "C:\Users\Start\venv\Pyhon3.7\lib\site-packages\pandas\__init__.py", line 38, in <module> "the C extensions first.".format(module) ImportError: C extension: DLL load failed: %1 is not a valid Win32 application. not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace --force' to build the C extensions first.
答案 0 :(得分:0)
如果您使用的是Pycharm
请检查您使用的python版本是否也是64位。如果没有,那可能就是问题所在。您将使用32位python版本,并已为pandas库安装了64位二进制文件。 您也可以转到Unofficial Windows Binaries for Python Extension Packages查找任何python库。