Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am getting the "ImportError: DLL load failed: The specified module could not be found." when importing the module seaborn.

I tried uninstalling both seaborn and matplotlib, then reinstalling by using

pip install seaborn 

but no luck. I still get the same error.

ImportError                               Traceback (most recent call last)
<ipython-input-5-085c0287ecb5> in <module>()
----> 1 import seaborn

C:\Users\johnsam\venv\lib\site-packages\seaborn\__init__.py in <module>()
      4 
      5 # Import seaborn objects
----> 6 from .rcmod import *
      7 from .utils import *
      8 from .palettes import *

C:\Users\johnsam\venv\lib\site-packages\seaborn\rcmod.py in <module>()
      6 import matplotlib as mpl
      7 
----> 8 from . import palettes, _orig_rc_params
      9 
     10 

C:\Users\johnsam\venv\lib\site-packages\seaborn\palettes.py in <module>()
     10 from .external.six.moves import range
     11 
---> 12 from .utils import desaturate, set_hls_values, get_color_cycle
     13 from .xkcd_rgb import xkcd_rgb
     14 from .crayons import crayons

C:\Users\johnsam\venv\lib\site-packages\seaborn\utils.py in <module>()
      6 
      7 import numpy as np
----> 8 from scipy import stats
      9 import pandas as pd
     10 import matplotlib as mpl

C:\Program Files\Continuum\Anaconda3\lib\site-packages\scipy\stats\__init__.py in <module>()
    332 from __future__ import division, print_function, absolute_import
    333 
--> 334 from .stats import *
    335 from .distributions import *
    336 from .rv import *

C:\Program Files\Continuum\Anaconda3\lib\site-packages\scipy\stats\stats.py in <module>()
    179 from scipy.lib.six import callable, string_types
    180 from numpy import array, asarray, ma, zeros, sum
--> 181 import scipy.special as special
    182 import scipy.linalg as linalg
    183 import numpy as np

C:\Program Files\Continuum\Anaconda3\lib\site-packages\scipy\special\__init__.py in <module>()
    544 from __future__ import division, print_function, absolute_import
    545 
--> 546 from ._ufuncs import *
    547 
    548 from .basic import *

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

Is there a way to get around this error?

like image 787
Ariel Avatar asked Apr 21 '17 18:04

Ariel


People also ask

How do you resolve Importerror DLL load failed the specified module could not be found?

importerror: dll load failed: The specified module could not be found error occurs because of the incompatibilities of Microsoft Visual C++ (Visual Studio) versions. The best way to fix this error (importerror: dll load failed) is to reinstall/ install the Microsoft Visual C++ distribution.

How can I fix Importerror DLL load failed the specified module could not be found in Python 3?

Reinstall Library. In most cases, the error occurs when you import a library. The cause of the error may be incorrect/incomplete installation or incompatibility of the library. In this case, you can try reinstalling the library to see whether the problem can be solved.

Why Seaborn is not working in Jupyter?

Why is Seaborn not working in Jupyter or other data Visualization environments? The typical reason for this error is that the Seaborn package is simply not installed in your environment. Before starting your troubleshooting, you might want to use the command pip list to find out the packages that are installed.


2 Answers

I was having this issue until I uninstalled and reinstalled scipy with the pip command. Just got to your command line and type pip uninstall scipy and pip install scipy.

Hopefully that works for you as well. I also uninstalled/installed seaborn before this although I'm not sure if that was necessary.

Using conda rather than pip may also work.

like image 63
cloudlandmap Avatar answered Sep 19 '22 03:09

cloudlandmap


What solved this for me was installing seaborn via conda:

conda install seaborn

And then restarting the kernel

like image 35
Pythoner Avatar answered Sep 20 '22 03:09

Pythoner