Skip to content
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 · 36 comments · Fixed by #21321
Closed

Pandas 0.23.0 gives ImportError: DLL load failed #21106

manish59 opened this issue May 17, 2018 · 36 comments · Fixed by #21321
Labels
Build Library building on various platforms
Milestone

Comments

@manish59
Copy link

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
Copy link
Contributor

How'd you install pandas?

@manish59
Copy link
Author

manish59 commented May 17, 2018 via email

@manish59
Copy link
Author

manish59 commented May 17, 2018 via email

@TomAugspurger
Copy link
Contributor

Can you paste the output from your pip install?

@manish59
Copy link
Author

manish59 commented May 17, 2018 via email

@TomAugspurger
Copy link
Contributor

TomAugspurger commented May 17, 2018 via email

@manish59
Copy link
Author

manish59 commented May 17, 2018 via email

@chris-b1
Copy link
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
Copy link
Contributor

TomAugspurger commented May 17, 2018 via email

@gfyoung gfyoung added the Build Library building on various platforms label May 21, 2018
@mezitax
Copy link

mezitax commented May 21, 2018

I have the same problem

pip 10.0.1
python 3.6
NumPy 1.14.3

@chris-b1
Copy link
Contributor

chris-b1 commented May 22, 2018 via email

@abador
Copy link

abador commented May 22, 2018

Installation of pandas 0.22.0 seemed to help some of my students

@TomAugspurger
Copy link
Contributor

TomAugspurger commented May 22, 2018 via email

@asangansi
Copy link

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
Copy link
Member

@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
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

PR was #19549

@cgohlke
Copy link
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
Copy link
Contributor

jreback commented May 23, 2018

we have used c++ for quite some time

@jorisvandenbossche
Copy link
Member

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

@chris-b1
Copy link
Contributor

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

@manish59
Copy link
Author

manish59 commented May 24, 2018 via email

@jreback
Copy link
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
Copy link
Member

@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
Copy link

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
Copy link
Author

manish59 commented May 29, 2018 via email

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

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

@FalconMadhab
Copy link

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

@hashstat
Copy link

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
Copy link

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!

@deepsach
Copy link

I get an error
Attribute error:module'numpy' has no attribute__version__
File:C/python /python36 /lib/ site package /pandas /init
From pandas .compat.numpy import(
File:C/python /python36 /lib/ site package /pandas /compat/numpy/init
Attribute error:module'numpy' has no attribute__version__
Please help me to get rid from this error
I stuck in this error from last 5 days I uninstalled panda numpy again and again but nothing will work

@sulaksh451
Copy link

I installed panda,, still facing issue in Intellij, Please help me.

Traceback (most recent call last):
File "C:/Users/SBoddula/IdeaProjects/Automation_IS/src/Morpheus.py", line 1, in
import pandas as pd
File "C:\Users\SBoddula\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas_init_.py", line 185, in
v = get_versions()
File "C:\Users\SBoddula\AppData\Local\Programs\Python\Python37\lib\site-packages\pandas_version.py", line 21, in get_versions
return json.loads(version_json)
AttributeError: module 'json' has no attribute 'loads'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Library building on various platforms
Projects
None yet
Development

Successfully merging a pull request may close this issue.