9

Updated to new Anaconda 2018, opened a jupyter notebook that worked prior to the update. Having problems with loading seaborn into the script. Tried following several threads on this but nothing worked question.

I've tried:

-Setting Enviromental Variables

-Reinstalling Anaconda2018

-Uninstalled and reinstalled seaborn using conda

-Reinstalled SciPy

Running out of options as I want to use Seaborn 0.9.0 and python-3.7 but I cannot seem to get 3.7 to play with 0.9.0. Help?

import seaborn as sns 

  ImportError                               Traceback (most recent call last)
  <ipython-input-1-a84c0541e888> in <module>
  ----> 1 import seaborn as sns

  ~\Anaconda3\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 *

  ~\Anaconda3\lib\site-packages\seaborn\rcmod.py in <module>
  3 import functools
  4 import matplotlib as mpl
  ----> 5 from . import palettes, _orig_rc_params
  6 
  7 

  ~\Anaconda3\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 .colors import xkcd_rgb, crayons
  14 

  ~\Anaconda3\lib\site-packages\seaborn\utils.py in <module>
  5 
  6 import numpy as np
  ----> 7 from scipy import stats
  8 import pandas as pd
  9 import matplotlib as mpl

  ~\Anaconda3\lib\site-packages\scipy\stats\__init__.py in <module>
  343 from __future__ import division, print_function, absolute_import
  344 
  --> 345 from .stats import *
  346 from .distributions import *
  347 from .morestats import *

  ~\Anaconda3\lib\site-packages\scipy\stats\stats.py in <module>
  169 import scipy.special as special
  170 import scipy.linalg as linalg
  --> 171 from . import distributions
  172 from . import mstats_basic
  173 from ._distn_infrastructure import _lazywhere

  ~\Anaconda3\lib\site-packages\scipy\stats\distributions.py in <module>
  8 from __future__ import division, print_function, absolute_import
  9 
  ---> 10 from ._distn_infrastructure import (entropy, rv_discrete, rv_continuous,
  11                                     rv_frozen)
  12 

  ~\Anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py in <module>
  22 
  23 # for root finding for discrete distribution ppf, and max likelihood estimation
  ---> 24 from scipy import optimize
  25 
  26 # for functions of continuous distributions (e.g. moments, entropy, cdf)

  ~\Anaconda3\lib\site-packages\scipy\optimize\__init__.py in <module>
  269 
  270 from .optimize import *
  --> 271 from ._minimize import *
  272 from ._root import *
  273 from .minpack import *

  ~\Anaconda3\lib\site-packages\scipy\optimize\_minimize.py in <module>
  19 from scipy._lib.six import callable
  20 
  ---> 21 from scipy.sparse.linalg import LinearOperator
  22 
  23 # unconstrained minimization

  ~\Anaconda3\lib\site-packages\scipy\sparse\linalg\__init__.py in <module>
  115 from .dsolve import *
  116 from .interface import *
  --> 117 from .eigen import *
  118 from .matfuncs import *
  119 from ._onenormest import *

  ~\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\__init__.py in <module>
  9 from __future__ import division, print_function, absolute_import
  10 
  ---> 11 from .arpack import *
  12 from .lobpcg import *
  13 

  ~\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\__init__.py in <module>
  20 from __future__ import division, print_function, absolute_import
  21 
  ---> 22 from .arpack import *

  ~\Anaconda3\lib\site-packages\scipy\sparse\linalg\eigen\arpack\arpack.py in <module>
  43 __all__ = ['eigs', 'eigsh', 'svds', 'ArpackError', 'ArpackNoConvergence']
  44 
  ---> 45 from . import _arpack
  46 import numpy as np
  47 import warnings

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

Any Tips on how to make my question better would also be welcomed as I want to get better at asking these questions.

AlexAMC
  • 347
  • 1
  • 4
  • 12

2 Answers2

13

I have met the same problem and be puzzled by it either this morning........

By carefully checking the Traceback ----> 4 from scipy.sparse.linalg import LinearOperator

It's the issue of scipy, not seaborn.

I try to uninstall conda versions and install pip versions scipy and numpy, it works now. please have a try, hopefully it could help u too.

$> conda remove --force numpy, scipy
$> pip install numpy
$> pip install scipy
xiao
  • 542
  • 1
  • 9
  • 16
  • 5
    Could you please let us know why pip works and conda does not. – Tejas Shetty Nov 06 '21 at 05:31
  • In my case, I also needed to uninstall numpy and scipy via pip uninstall ... and then do these steps above. Then it worked. – Banik Feb 21 '23 at 08:40
  • [Mixing conda and pip may have later consequences](https://www.anaconda.com/blog/using-pip-in-a-conda-environment). – mins Mar 12 '23 at 13:59
  • 1
    @TejasShetty - I might be able to help a bit with that one ... 2 years later... Conda seems to work like a stochastic algorithm when you try and install multiple libraries in one go (i.e. you might not get the exact version of everything every time) whereas pip is much more straightforward and handles dependencies less stochastically. Here is also another discussions https://stackoverflow.com/questions/20994716/what-is-the-difference-between-pip-and-conda – AlexAMC Apr 06 '23 at 13:50
3

i have removed completely seaborn, numpy and scipy then i reinstalled them and it works for me.

In my anaconda Powershell i excuted this command:

conda remove --force seaborn numpy scipy

then, in jupyter notebook and execut this in one cell.

pip install seaborn numpy scipy