Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

python - Unable to import pandas (pandas._libs.window.aggregations)

I've lost a couple of hours trying to solve this so I guess it's time to ask someone/somehwere.

I (think) I have uninstalled everything related to python and than installed again. I just installed python most recent version and used pip to install pandas. I also try to install it with anaconda but the error persists. I've also tried installing directly from github but was unsuccessful. I'm using windows 10.

C:Usersm>python -V
Python 3.8.2

C:Usersm>pip install pandas
Collecting pandas
  Downloading https://files.pythonhosted.org/packages/07/12/5a087658337a230f4a77e3d548c847e81aa59b332cdd8ddf5c8d7f11c4a1/pandas-1.0.3-cp38-cp38-win32.whl (7.6MB)
     |████████████████████████████████| 7.6MB 3.3MB/s
Collecting pytz>=2017.2 (from pandas)
  Downloading https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl (509kB)
     |████████████████████████████████| 512kB 3.2MB/s
Collecting python-dateutil>=2.6.1 (from pandas)
  Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB)
     |████████████████████████████████| 235kB 6.4MB/s
Collecting numpy>=1.13.3 (from pandas)
  Downloading https://files.pythonhosted.org/packages/5d/b3/f3543d9919baa11afc24adc029a25997821f0376e5fab75fdc16e13469db/numpy-1.18.2-cp38-cp38-win32.whl (10.8MB)
     |████████████████████████████████| 10.8MB 6.4MB/s
Requirement already satisfied: six>=1.5 in c:usersmappdata
oamingpythonpython38site-packages (from python-dateutil>=2.6.1->pandas) (1.13.0)
Installing collected packages: pytz, python-dateutil, numpy, pandas
Successfully installed numpy-1.18.2 pandas-1.0.3 python-dateutil-2.8.1 pytz-2019.3
WARNING: You are using pip version 19.2.3, however version 20.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

C:Usersm>python
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 22:45:29) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:UsersmAppDataLocalProgramsPythonPython38-32libsite-packagespandas\__init__.py", line 55, in <module>
    from pandas.core.api import (
  File "C:UsersmAppDataLocalProgramsPythonPython38-32libsite-packagespandascoreapi.py", line 29, in <module>
    from pandas.core.groupby import Grouper, NamedAgg
  File "C:UsersmAppDataLocalProgramsPythonPython38-32libsite-packagespandascoregroupby\__init__.py", line 1, in <module>
    from pandas.core.groupby.generic import DataFrameGroupBy, NamedAgg, SeriesGroupBy
  File "C:UsersmAppDataLocalProgramsPythonPython38-32libsite-packagespandascoregroupbygeneric.py", line 60, in <module>
    from pandas.core.frame import DataFrame
  File "C:UsersmAppDataLocalProgramsPythonPython38-32libsite-packagespandascoreframe.py", line 124, in <module>
    from pandas.core.series import Series
  File "C:UsersmAppDataLocalProgramsPythonPython38-32libsite-packagespandascoreseries.py", line 4572, in <module>
    Series._add_series_or_dataframe_operations()
  File "C:UsersmAppDataLocalProgramsPythonPython38-32libsite-packagespandascoregeneric.py", line 10349, in _add_series_or_dataframe_operations
    from pandas.core.window import EWM, Expanding, Rolling, Window
  File "C:UsersmAppDataLocalProgramsPythonPython38-32libsite-packagespandascorewindow\__init__.py", line 1, in <module>
    from pandas.core.window.ewm import EWM  # noqa:F401
  File "C:UsersmAppDataLocalProgramsPythonPython38-32libsite-packagespandascorewindowewm.py", line 5, in <module>
    import pandas._libs.window.aggregations as window_aggregations
ImportError: DLL load failed while importing aggregations: The specified module could not be found.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I finally ended up trying a slightly older version of pandas to resolve this exact error. The default install was 1.0.3, so I backed up a couple of release points:

pip uninstall pandas
pip install pandas==1.0.1

Then I could import pandas without error


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...