0

In trying to import and run pandas in Pycharm I get the following error:

<<<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.

I've tried upgrading pandas and reverting to version 1.0.1 to no avail. I've also specified the exact requirements package that is working for me on google collab in the requirements file (pandas==1.1.5)

I've also tried installing bzip2 https://www.sourceware.org/bzip2/downloads.html but it doesn't resolve the issue.

I found a similar issue here with no resolution otherwise: Python3.7.4 - Error while importing pandas libraries

Mark McGown
  • 975
  • 1
  • 10
  • 26
  • it seems it needs C/C++ library `BZ2` which you may have to install manually. Maybe find precompiled version for WIndows and put in folder which you have in `PATH` – furas Feb 18 '21 at 02:06
  • there is page[Unofficial Windows Binaries for Python Extension Packages](https://www.lfd.uci.edu/~gohlke/pythonlibs/) and maybe it will have `pandas` with missing library. OR you may try to use `Anaconda` instead of `CPython` because it also should have precompiled `pandas` and it should be better tested. – furas Feb 18 '21 at 02:17

0 Answers0