在尝试在 Pycharm 中导入和运行 pandas 时,出现以下错误:
<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\numpy\_distributor_init.py:32: UserWarning: loaded more than 1 DLL from .libs:
<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\numpy\.libs\libopenblas.NOIJJG62EMASZI6NYURL6JBKM4EVBGM7.gfortran-win_amd64.dll
<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\numpy\.libs\libopenblas.PYQHXLVVQ7VESDPUVUADXEVJOBGHJPAY.gfortran-win_amd64.dll
<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\numpy\.libs\libopenblas.TXA6YQSD3GCQQC22GEQ54J2UDCXDXHWN.gfortran-win_amd64.dll
stacklevel=1)
Traceback (most recent call last):
File "<<<Path_To_Project>>>/main.py", line 1, in <module>
import pandas as pd
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\pandas\__init__.py", line 52, in <module>
from pandas.core.api import (
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\pandas\core\api.py", line 29, in <module>
from pandas.core.groupby import Grouper, NamedAgg
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\pandas\core\groupby\__init__.py", line 1, in <module>
from pandas.core.groupby.generic import DataFrameGroupBy, NamedAgg, SeriesGroupBy
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\pandas\core\groupby\generic.py", line 57, in <module>
from pandas.core.aggregation import (
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\pandas\core\aggregation.py", line 27, in <module>
from pandas.core.series import FrameOrSeriesUnion, Series
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\pandas\core\series.py", line 68, in <module>
from pandas.core import algorithms, base, generic, nanops, ops
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\pandas\core\generic.py", line 102, in <module>
from pandas.io.formats import format as fmt
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\pandas\io\formats\format.py", line 71, in <module>
from pandas.io.common import stringify_path
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\site-packages\pandas\io\common.py", line 3, in <module>
import bz2
File "<<<Path_To_Desktop>>>\<<SubDir>>>\lib\bz2.py", line 23, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ImportError: DLL load failed: The specified module could not be found.
我尝试升级熊猫并恢复到版本 1.0.1 无济于事。我还在需求文件(pandas==1.1.5)中指定了在 google collab 上为我工作的确切需求包
我也试过安装 bzip2 https://www.sourceware.org/bzip2/downloads.html但它不能解决问题。
我在这里发现了一个类似的问题,否则没有解决方案:Python3.7.4 - Error while importing pandas library