我正在使用Python 3.5,我正在pycharm IDE中导入Pandas,Numpy,scikit-learn和pickle库。我也通过pycharm IDE的软件包安装程序安装了所有库。当我执行以下命令时,它在IDE中没有给出“语法”错误。
import pickle
from pathlib import Path
import numpy as np
import pandas as pd
from sklearn import metrics
from sklearn.cluster import KMeans
当我执行我的代码时,它为我提供了以下错误,专门导入“pandas”库。 - >
Traceback (most recent call last):
File "D:/InputFile.py", line 5, in <module>
import pandas as pd
File "C:\Users\sneha\AppData\Local\Temp\InputFile.py\venv\lib\site-packages\pandas\__init__.py", line 42, in <module>
from pandas.core.api import *
File "C:\Users\sneha\AppData\Local\Temp\InputFile.py\venv\lib\site-packages\pandas\core\api.py", line 10, in <module>
from pandas.core.groupby.groupby import Grouper
File "C:\Users\sneha\AppData\Local\Temp\InputFile.py\venv\lib\site-packages\pandas\core\groupby\__init__.py", line 2, in <module>
from pandas.core.groupby.groupby import (
File "C:\Users\sneha\AppData\Local\Temp\InputFile.py\venv\lib\site-packages\pandas\core\groupby\groupby.py", line 49, in <module>
from pandas.core.frame import DataFrame
File "C:\Users\sneha\AppData\Local\Temp\InputFile.py\venv\lib\site-packages\pandas\core\frame.py", line 74, in <module>
from pandas.core.series import Series
File "C:\Users\sneha\AppData\Local\Temp\InputFile.py\venv\lib\site-packages\pandas\core\series.py", line 3978, in <module>
Series._add_series_or_dataframe_operations()
File "C:\Users\sneha\AppData\Local\Temp\InputFile.py\venv\lib\site-packages\pandas\core\generic.py", line 8891, in _add_series_or_dataframe_operations
from pandas.core import window as rwindow
File "C:\Users\sneha\AppData\Local\Temp\InputFile.py\venv\lib\site-packages\pandas\core\window.py", line 36, in <module>
import pandas._libs.window as _window
ImportError: DLL load failed: The specified module could not be found.
我已经为此进行了修改并尝试了不同的解决方案,但无法解决此错误。
尝试过的解决方案:
答案 0 :(得分:1)
尝试在命令提示符
中键入以重新安装pandaspip uninstall pandas
pip install pandas
答案 1 :(得分:0)
当我安装pandas 0.23.0时,我遇到了类似的问题 如果您使用的是pandas 0.23.0,请将其卸载并重新安装0.22.0
它适用于我的案例