Error while importing seaborn in Anaconda - python-3.x

I'm getting the below error while importing seaborn.
Installing/Uninstalling is not working.
Copying dll files in win32 folder and setting path didn't work.I'm using 32-bit windows 7 machine. output of sys.path as below :
['',
'C:\\Users\\PAL\\Anaconda3\\python35.zip',
'C:\\Users\\PAL\\Anaconda3\\DLLs',
'C:\\Users\\PAL\\Anaconda3\\lib',
'C:\\Users\\PAL\\Anaconda3',
'C:\\Users\\PAL\\Anaconda3\\lib\\site-packages',
'C:\\Users\\PAL\\Anaconda3\\lib\\site-packages\\Sphinx-1.4.1-py3.5.egg',
'C:\\Users\\PAL\\Anaconda3\\lib\\site-packages\\win32',
'C:\\Users\\PAL\\Anaconda3\\lib\\site-packages\\win32\\lib',
'C:\\Users\\PAL\\Anaconda3\\lib\\site-packages\\Pythonwin',
'C:\\Users\\PAL\\Anaconda3\\lib\\site-packages\\setuptools-23.0.0-py3.5.egg',
'C:\\Users\\PAL\\Anaconda3\\lib\\site-packages\\IPython\\extensions',
'C:\\Users\\PAL\\.ipython']
Error while importing seaborn:
ImportError Traceback (most recent call last)
in ()
----> 1 import seaborn as sns
C:\Users\PAL\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 *
C:\Users\PAL\Anaconda3\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\PAL\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 .xkcd_rgb import xkcd_rgb
14 from .crayons import crayons
C:\Users\PAL\Anaconda3\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:\Users\PAL\Anaconda3\lib\site-packages\scipy\stats\__init__.py in <module>()
336 from __future__ import division, print_function, absolute_import
337
--> 338 from .stats import *
339 from .distributions import *
340 from .morestats import *
C:\Users\PAL\Anaconda3\lib\site-packages\scipy\stats\stats.py in <module>()
178 from scipy._lib.six import callable, string_types
179 from numpy import array, asarray, ma, zeros
--> 180 import scipy.special as special
181 import scipy.linalg as linalg
182 import numpy as np
C:\Users\PAL\Anaconda3\lib\site-packages\scipy\special\__init__.py in <module>()
625 from __future__ import division, print_function, absolute_import
626
--> 627 from ._ufuncs import *
628
629 from .basic import *
ImportError: DLL load failed: The specified procedure could not be
found.

Related

Why do I have problems with TensorFlow in Jupyter?

I have been fine with my Jupyter notebook for running my python codes for some time. However, I recently picked interests in Style Transfer with deep learning. The codes I got for practice required that I downgrade TensorFlow to a lower version. Fortunately, this worked but unfortunately, all other codes that I have developed for months (requiring TensorFlow backend) stopped working. I tried using JupyterLab and sometimes, they worked while most times, I get the same error just as in Jupyter notebook. Now, the only get around is to move my codes to Spyder (which is quite frustrating).
Every time I run my codes, I get the following error:
AttributeError Traceback (most recent call last)
<ipython-input-2-6d5587dfcc0c> in <module>
1 # import all libraries
----> 2 import keras
3 from keras.models import Sequential
4 from keras.layers import Dense, Activation, Dropout
5 from keras.layers.convolutional import Conv1D
~\Miniconda3\envs\tensorflow\lib\site-packages\keras\__init__.py in <module>
1 from __future__ import absolute_import
2
----> 3 from . import utils
4 from . import activations
5 from . import applications
~\Miniconda3\envs\tensorflow\lib\site-packages\keras\utils\__init__.py in <module>
4 from . import data_utils
5 from . import io_utils
----> 6 from . import conv_utils
7
8 # Globally-importable utils.
~\Miniconda3\envs\tensorflow\lib\site-packages\keras\utils\conv_utils.py in <module>
7 from six.moves import range
8 import numpy as np
----> 9 from .. import backend as K
10
11
~\Miniconda3\envs\tensorflow\lib\site-packages\keras\backend\__init__.py in <module>
87 elif _BACKEND == 'tensorflow':
88 sys.stderr.write('Using TensorFlow backend.\n')
---> 89 from .tensorflow_backend import *
90 else:
91 # Try and load external backend.
~\Miniconda3\envs\tensorflow\lib\site-packages\keras\backend\tensorflow_backend.py in <module>
3 from __future__ import print_function
4
----> 5 import tensorflow as tf
6 from tensorflow.python.framework import ops as tf_ops
7 from tensorflow.python.training import moving_averages
~\Miniconda3\envs\tensorflow\lib\site-packages\tensorflow\__init__.py in <module>
22
23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
25
26 try:
~\Miniconda3\envs\tensorflow\lib\site-packages\tensorflow\python\__init__.py in <module>
86 # Bring in subpackages.
87 from tensorflow.python import data
---> 88 from tensorflow.python import keras
89 from tensorflow.python.feature_column import feature_column_lib as feature_column
90 from tensorflow.python.layers import layers
~\Miniconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\__init__.py in <module>
23
24 from tensorflow.python.keras import activations
---> 25 from tensorflow.python.keras import applications
26 from tensorflow.python.keras import backend
27 from tensorflow.python.keras import callbacks
~\Miniconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\applications\__init__.py in
<module>
23
24 from tensorflow.python.keras import backend
---> 25 from tensorflow.python.keras import engine
26 from tensorflow.python.keras import layers
27 from tensorflow.python.keras import models
~\Miniconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\__init__.py in
<module>
21 # TODO(fchollet): Remove hourglass imports once external code is done importing
22 # non-public APIs.
---> 23 from tensorflow.python.keras.engine.base_layer import InputSpec
24 from tensorflow.python.keras.engine.base_layer import Layer
25 from tensorflow.python.keras.engine.input_layer import Input
~\Miniconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\engine\base_layer.py in
<module>
37 from tensorflow.python.keras import initializers
38 from tensorflow.python.keras import regularizers
---> 39 from tensorflow.python.keras.utils import generic_utils
40 from tensorflow.python.keras.utils import tf_utils
41 # A module that only depends on `keras.layers` import these from here.
~\Miniconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\utils\__init__.py in <module>
30 from tensorflow.python.keras.utils.generic_utils import Progbar
31 from tensorflow.python.keras.utils.generic_utils import serialize_keras_object
---> 32 from tensorflow.python.keras.utils.io_utils import HDF5Matrix
33 from tensorflow.python.keras.utils.layer_utils import convert_all_kernels_in_model
34 from tensorflow.python.keras.utils.layer_utils import get_source_inputs
~\Miniconda3\envs\tensorflow\lib\site-packages\tensorflow\python\keras\utils\io_utils.py in <module>
27
28 try:
---> 29 import h5py
30 except ImportError:
31 h5py = None
~\Miniconda3\envs\tensorflow\lib\site-packages\h5py\__init__.py in <module>
32 raise
33
---> 34 from . import version
35
36 if version.hdf5_version_tuple != version.hdf5_built_version_tuple:
~\Miniconda3\envs\tensorflow\lib\site-packages\h5py\version.py in <module>
15
16 from collections import namedtuple
---> 17 from . import h5 as _h5
18 import sys
19 import numpy
h5py\h5.pyx in init h5py.h5()
AttributeError: type object 'h5py.h5.H5PYConfig' has no attribute '__reduce_cython__'
How do I rectify this situation?
Many thanks in anticipation of your suggestions.

ModuleNotFoundError: No module named 'quantmod.theming'

Trying to install quantmod in Python 3.6 and getting this error:
ModuleNotFoundError: No module named 'quantmod.theming'
Here are the imports:
import pandas as pd
pd.core.common.is_list_like = pd.api.types.is_list_like
import numpy as np
import plotly.graph_objs as go
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
init_notebook_mode(connected=True)
from plotly import tools
from datetime import datetime
from dateutil import parser
import quantmod as qm
Here is the error:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-11-e0fff5c4d1f1> in <module>()
8 from datetime import datetime
9 from dateutil import parser
---> 10 import quantmod as qm
~\Anaconda3\lib\site-packages\quantmod-0.1.3-py3.6.egg\quantmod\__init__.py in <module>()
21 from __future__ import absolute_import
22
---> 23 from .core import *
24 from .chart import *
25 from .tools import (go_offline, go_online, is_offline,
~\Anaconda3\lib\site-packages\quantmod-0.1.3-py3.6.egg\quantmod\core.py in <module>()
11 import pandas_datareader.data as web
12
---> 13 from .chart import Chart
14
15
~\Anaconda3\lib\site-packages\quantmod-0.1.3-py3.6.egg\quantmod\chart.py in <module>()
20
21 from . import tools
---> 22 from . import factory
23 from .valid import VALID_FIGURE_KWARGS, VALID_TRACES, OHLC_TRACES
24 from .ta import * # noqa : F405
~\Anaconda3\lib\site-packages\quantmod-0.1.3-py3.6.egg\quantmod\factory.py in <module>()
12 from . import utils
13 from . import tools
---> 14 from .theming.skeleton import SKELETON
15 from .theming.themes import THEMES
16 from .vendors.sources import SOURCES
ModuleNotFoundError: No module named 'quantmod.theming'
I'm not sure how to interpret this.

How to Fix: "ImportError: DLL load failed The specified procedure could not be found." when the DLLs are there

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

why import sklearn is not working in Jupyter?

I installed the recent version of Anaconda but "Import sklearn" gives an error
ImportError Traceback (most recent call last)
<ipython-input-5-b7c74cbf5af0> in <module>
----> 1 import sklearn
~\anaconda3\lib\site-packages\sklearn\__init__.py in <module>
62 else:
63 from . import __check_build
---> 64 from .base import clone
65 from .utils._show_versions import show_versions
66
~\anaconda3\lib\site-packages\sklearn\base.py in <module>
11 from scipy import sparse
12 from .externals import six
---> 13 from .utils.fixes import signature
14 from . import __version__
15
~\anaconda3\lib\site-packages\sklearn\utils\__init__.py in <module>
14 from . import _joblib
15 from ..exceptions import DataConversionWarning
---> 16 from .fixes import _Sequence as Sequence
17 from .deprecation import deprecated
18 from .validation import (as_float_array,
~\anaconda3\lib\site-packages\sklearn\utils\fixes.py in <module>
90 from ._scipy_sparse_lsqr_backport import lsqr as sparse_lsqr
91 else:
---> 92 from scipy.sparse.linalg import lsqr as sparse_lsqr # noqa
93
94
~\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.
I found out what the problem was. I had created an env file for Jupyter and edited it to open jupyter in Chrome. After updating python, import sklearn did not work. So I had to go back and delete that env file and everything worked fine after that. Hope this helps future readers of this post.

Import error while importing tensorflow,keras

I installed tensorflow 1.8. When import kerasor import tensorflow.Iam getting
ImportError Traceback (most recent call last)
<ipython-input-2-dc6fd3b71e3e> in <module>
----> 1 from keras.preprocessing.text import Tokenizer
2 from keras.preprocessing.sequence import pad_sequences
3 from keras.models import Sequential
4 from keras.layers import Dense, Flatten, LSTM, Conv1D, MaxPooling1D, Dropout, Activation
5 from keras.layers.embeddings import Embedding
~\Anaconda3\lib\site-packages\keras\__init__.py in <module>
1 from __future__ import absolute_import
2
----> 3 from . import utils
4 from . import activations
5 from . import applications
~\Anaconda3\lib\site-packages\keras\utils\__init__.py in <module>
4 from . import data_utils
5 from . import io_utils
----> 6 from . import conv_utils
7
8 # Globally-importable utils.
~\Anaconda3\lib\site-packages\keras\utils\conv_utils.py in <module>
7 from six.moves import range
8 import numpy as np
----> 9 from .. import backend as K
10
11
~\Anaconda3\lib\site-packages\keras\backend\__init__.py in <module>
87 elif _BACKEND == 'tensorflow':
88 sys.stderr.write('Using TensorFlow backend.\n')
---> 89 from .tensorflow_backend import *
90 else:
91 # Try and load external backend.
~\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py in <module>
3 from __future__ import print_function
4
----> 5 import tensorflow as tf
6 from tensorflow.python.framework import ops as tf_ops
7 from tensorflow.python.training import moving_averages
~\Anaconda3\lib\site-packages\tensorflow\__init__.py in <module>
22
23 # pylint: disable=g-bad-import-order
---> 24 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
25
26 try:
~\Anaconda3\lib\site-packages\tensorflow\python\__init__.py in <module>
57
58 # Protocol buffers
---> 59 from tensorflow.core.framework.graph_pb2 import *
60 from tensorflow.core.framework.node_def_pb2 import *
61 from tensorflow.core.framework.summary_pb2 import *
~\Anaconda3\lib\site-packages\tensorflow\core\framework\graph_pb2.py in <module>
4 import sys
5 _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
----> 6 from google.protobuf import descriptor as _descriptor
7 from google.protobuf import message as _message
8 from google.protobuf import reflection as _reflection
~\Anaconda3\lib\site-packages\google\protobuf\descriptor.py in <module>
45 import binascii
46 import os
---> 47 from google.protobuf.pyext import _message
48 _USE_C_DESCRIPTORS = getattr(_message, '_USE_C_DESCRIPTORS', False)
49
ImportError: DLL load failed: The specified procedure could not be found.
Please someone help me with this.

Resources