New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pandas 0.23.0 gives ImportError: DLL load failed #21106

Closed
manish59 opened this Issue May 17, 2018 · 34 comments

Comments

Projects
None yet
@manish59

manish59 commented May 17, 2018

Installed pandas not able to import with:

ImportError: DLL load failed: The specified module could not be found.

As far as we know, this happens if you install with pip on Windows 32bit machines (if you have another case, please comment below with specifying your OS, Python version, how you installed pandas, ..).

Workaround for now is to keep your version at pandas 0.22.0. (or to install using conda, or to install VS tools for C++, see #21106 (comment))

We will fix this problem for 0.23.1.


original post:

Code Sample, a copy-pastable example if possible

import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\lfletcher\AppData\Local\Programs\Python\Python36-32\lib\site-pa
ckages\pandas\__init__.py", line 42, in <module>
    from pandas.core.api import *
  File "C:\Users\lfletcher\AppData\Local\Programs\Python\Python36-32\lib\site-pa
ckages\pandas\core\api.py", line 10, in <module>
    from pandas.core.groupby.groupby import Grouper
  File "C:\Users\lfletcher\AppData\Local\Programs\Python\Python36-32\lib\site-pa
ckages\pandas\core\groupby\__init__.py", line 2, in <module>
    from pandas.core.groupby.groupby import (
  File "C:\Users\lfletcher\AppData\Local\Programs\Python\Python36-32\lib\site-pa
ckages\pandas\core\groupby\groupby.py", line 49, in <module>
    from pandas.core.frame import DataFrame
  File "C:\Users\lfletcher\AppData\Local\Programs\Python\Python36-32\lib\site-pa
ckages\pandas\core\frame.py", line 74, in <module>
    from pandas.core.series import Series
  File "C:\Users\lfletcher\AppData\Local\Programs\Python\Python36-32\lib\site-pa
ckages\pandas\core\series.py", line 3978, in <module>
    Series._add_series_or_dataframe_operations()
  File "C:\Users\lfletcher\AppData\Local\Programs\Python\Python36-32\lib\site-pa
ckages\pandas\core\generic.py", line 8891, in _add_series_or_dataframe_operation
s
    from pandas.core import window as rwindow
  File "C:\Users\lfletcher\AppData\Local\Programs\Python\Python36-32\lib\site-pa
ckages\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.
@TomAugspurger

This comment has been minimized.

Contributor

TomAugspurger commented May 17, 2018

How'd you install pandas?

@manish59

This comment has been minimized.

manish59 commented May 17, 2018

@manish59

This comment has been minimized.

manish59 commented May 17, 2018

@TomAugspurger

This comment has been minimized.

Contributor

TomAugspurger commented May 17, 2018

Can you paste the output from your pip install?

@manish59

This comment has been minimized.

manish59 commented May 17, 2018

@TomAugspurger

This comment has been minimized.

Contributor

TomAugspurger commented May 17, 2018

@manish59

This comment has been minimized.

manish59 commented May 17, 2018

@chris-b1

This comment has been minimized.

Contributor

chris-b1 commented May 17, 2018

How did you install python? You seem to be on 32 bit windows which is less tested, but I just tried with a clean conda environment and it worked fine

set CONDA_FORCE_32BIT=1
conda create -n py36_32 python=3.6 numpy -y
activate py36_32
pip install pandas
python -c "import pandas"
@TomAugspurger

This comment has been minimized.

Contributor

TomAugspurger commented May 17, 2018

@gfyoung gfyoung added the Build label May 21, 2018

@mezitax

This comment has been minimized.

mezitax commented May 21, 2018

I have the same problem

pip 10.0.1
python 3.6
NumPy 1.14.3

@chris-b1

This comment has been minimized.

Contributor

chris-b1 commented May 22, 2018

@abador

This comment has been minimized.

abador commented May 22, 2018

Installation of pandas 0.22.0 seemed to help some of my students

@TomAugspurger

This comment has been minimized.

Contributor

TomAugspurger commented May 22, 2018

@asangansi

This comment has been minimized.

asangansi commented May 23, 2018

I can confirm this issue is due to 0.23
Uninstall then reinstall 0.22

pip uninstall pandas
pip install pandas==0.22
@jorisvandenbossche

This comment has been minimized.

Member

jorisvandenbossche commented May 23, 2018

@asangansi can you please give the additional information as mentioned here #21106 (comment). That would be helpful.

@jorisvandenbossche jorisvandenbossche added this to the 0.23.1 milestone May 23, 2018

@abador

This comment has been minimized.

abador commented May 23, 2018

As far as I can tell most of my students have libraries similar to this(copy from pyCharm settings):
et-xmlfile 1.0.1
jdcal 1.4 1.4
numpy 1.14.3 1.14.3
openpyxl 2.5.3 2.5.3
pandas 0.23.0 0.23.0
pip 9.0.1 10.0.1
python-dateutil 2.7.3 2.7.3
pytz 2018.4 2018.4
setuptools 28.8.0 39.2.0
six 1.11.0 1.11.0
xlrd 1.1.0 1.1.0

Python 3.6
Project in PyCharm 2018.1.1

@TomAugspurger

This comment has been minimized.

Contributor

TomAugspurger commented May 23, 2018

Not a whole lot to go on here, but @cgohlke do you have any guesses?

FWIW, _window.pyx is the first C++ pyx file in

pandas/setup.py

Line 334 in 1abfd1b

_cpp_pyxfiles = ['pandas/_libs/window.pyx',

@chris-b1

This comment has been minimized.

Contributor

chris-b1 commented May 23, 2018

Here's another failed attempt to repro, using a python.org binary.

# download, unzip, cd to root of  https://www.python.org/ftp/python/3.6.2/python-3.6.2-embed-win32.zip
rm python36._pth
curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
python get-pip.py
python -m pip install pandas
python
>>> import pandas
>>>
@chris-b1

This comment has been minimized.

Contributor

chris-b1 commented May 23, 2018

c++ is probably the issue, guessing missing the runtime DLL, though I'm not sure the best fix. From what I recall c++ wasn't particularly necessary for that change so could revert back to c for 0.23.1

Could someone one this issue try install the VS 2015 Redistributable and see if that fixes it for you?
https://www.microsoft.com/en-us/download/details.aspx?id=48145

@chris-b1

This comment has been minimized.

Contributor

chris-b1 commented May 23, 2018

PR was #19549

@cgohlke

This comment has been minimized.

Contributor

cgohlke commented May 23, 2018

The missing DLL is most probably MSVCP140.DLL, the MSVC C++ runtime library.

It is part of the Microsoft Visual C++ Redistributable for Visual Studio 2015/2017.

Some projects, e.g. matplotlib, include this DLL in the binary wheels.

@jreback

This comment has been minimized.

Contributor

jreback commented May 23, 2018

we have used c++ for quite some time

@jorisvandenbossche

This comment has been minimized.

Member

jorisvandenbossche commented May 23, 2018

But we were not using libcpp in cython code before. @jreback might that be a difference with previous c++ code of msgpack?

@chris-b1

This comment has been minimized.

Contributor

chris-b1 commented May 24, 2018

That's right, msgpack only depends on libc, where the window extension is utilizing the c++ std library.

@manish59

This comment has been minimized.

manish59 commented May 24, 2018

@jreback

This comment has been minimized.

Contributor

jreback commented May 25, 2018

@chris-b1 can you see what mpl is doing? maybe need a directive in setup.py? or the wheeel building step

@jorisvandenbossche

This comment has been minimized.

Member

jorisvandenbossche commented May 25, 2018

@cgohlke is this something you want to do? (including the binaries? similar as matplotlib) (since we are using your wheels to upload to pypi)

@sionking

This comment has been minimized.

sionking commented May 28, 2018

same here:

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\__init__.py", line 42, in <module>
    from pandas.core.api import *
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\core\api.py", line 10, in <module>
    from pandas.core.groupby.groupby import Grouper
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\core\groupby\__init__.py", line 2, in <module>
    from pandas.core.groupby.groupby import (
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\core\groupby\groupby.py", line 49, in <module>
    from pandas.core.frame import DataFrame
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\core\frame.py", line 74, in <module>
    from pandas.core.series import Series
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\core\series.py", line 3978, in <module>
    Series._add_series_or_dataframe_operations()
  File "C:\Program Files (x86)\Python36-32\lib\site-packages\pandas\core\generic.py", line 8891, in _add_series_or_dataframe_operations
    from pandas.core import window as rwindow
  File "C:\Program Files (x86)\Python36-32\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.
PS C:\Users\xxx\Dropbox\xxx>

version 23 fail.
version 22 works.

@manish59

This comment has been minimized.

manish59 commented May 29, 2018

@jorisvandenbossche jorisvandenbossche changed the title from Installed pandas not able to import it as comes this error to Pandas 0.23.0 gives ImportError: DLL load failed May 29, 2018

@jorisvandenbossche

This comment has been minimized.

Member

jorisvandenbossche commented Jun 4, 2018

Any updates on this? (somebody who can look at fixing the wheel building?)

Otherwise we can also revert the PR (it was only a performance improvement) for 0.23.1, but keep it in master so have more time to fix the wheel building for 0.24.0.

@chris-b1

This comment has been minimized.

Contributor

chris-b1 commented Jun 4, 2018

Could someone reporting on this issue (@manish59, @sionking, @asangansi, @abador, @mezitax ) please confirm that installing the redistributable fixes this for 0.23? Every windows machine I have access to already has it installed.

I'll look at what matplotlib does later today.

@chris-b1 chris-b1 referenced this issue Jun 5, 2018

Merged

BLD: include dll in package_data on Windows #21321

2 of 4 tasks complete
@FalconMadhab

This comment has been minimized.

FalconMadhab commented Jun 6, 2018

Yes. By uninstalling 0.23 and reinstalling 0.22 of pandas the problem is resolved. Thanks

@hashstat

This comment has been minimized.

hashstat commented Jun 8, 2018

I ran into the same issue on my Windows 10 x64 VM with Python 3.6.5 (64-bit). The exception was raised when version 0.23.0 was installed and was resolved when I downgraded to 0.22. It was also resolved by installing the MSVC++ redistributable.

@mezitax

This comment has been minimized.

mezitax commented Sep 25, 2018

Could someone reporting on this issue (@manish59, @sionking, @asangansi, @abador, @mezitax ) please confirm that installing the redistributable fixes this for 0.23? Every windows machine I have access to already has it installed.

I'll look at what matplotlib does later today.

when uninstalling 0.23 and reinstalling 0.22 the problem was solved, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment