I installed fastai as explained here in my ubuntu machine https://forums.fast.ai/t/wiki-thread-lesson-1/6825/63
However, when i import libraries, i am getting below error message.
from fastai import *
from fastai.text import *
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-9acdcc7330cd> in <module>
----> 1 from fastai import * # Quick access to most common functionality
2 from fastai.text import * # Quick access to NLP functionality
~/.local/lib/python3.6/site-packages/fastai/__init__.py in <module>
----> 1 from .basic_train import *
2 from .callback import *
3 #from .callbacks import *
4 from .core import *
5 from .basic_data import *
~/.local/lib/python3.6/site-packages/fastai/basic_train.py in <module>
1 "Provides basic training and validation with `Learner`"
----> 2 from .torch_core import *
3 from .basic_data import *
4 from .callback import *
5
~/.local/lib/python3.6/site-packages/fastai/torch_core.py in <module>
1 "Utility functions to help deal with tensors"
----> 2 from .imports.torch import *
3 from .core import *
4
5 AffineMatrix = Tensor
~/.local/lib/python3.6/site-packages/fastai/imports/__init__.py in <module>
----> 1 from .core import *
2 from .torch import *
~/.local/lib/python3.6/site-packages/fastai/imports/core.py in <module>
4 import abc, collections, hashlib, itertools, json, operator, pathlib
5 import mimetypes, inspect, typing, functools, importlib
----> 6 import html, re, spacy, requests, tarfile, numbers
7
8 from abc import abstractmethod, abstractproperty
~/.local/lib/python3.6/site-packages/spacy/__init__.py in <module>
6
7 # These are imported as part of the API
----> 8 from thinc.neural.util import prefer_gpu, require_gpu
9
10 from .cli.info import info as cli_info
~/.local/lib/python3.6/site-packages/thinc/neural/__init__.py in <module>
----> 1 from ._classes.model import Model
~/.local/lib/python3.6/site-packages/thinc/neural/_classes/model.py in <module>
10
11 from .. import util
---> 12 from ..train import Trainer
13 from ..ops import NumpyOps, CupyOps
14 from ..mem import Memory
~/.local/lib/python3.6/site-packages/thinc/neural/train.py in <module>
1 from __future__ import unicode_literals, print_function
2
----> 3 from .optimizers import Adam, SGD, linear_decay
4 from .util import minibatch
5
optimizers.pyx in init thinc.neural.optimizers()
ops.pyx in init thinc.neural.ops()
ImportError: /home/user/.local/lib/python3.6/site-packages/murmurhash/mrmr.cpython-36m-x86_64-linux-gnu.so: file too short
Can anyone help me on this please? I searched on the internet for hours and didn't find any information. Thanks
Related
I am getting this import error when trying to import brightway:
import brightway2 as bw
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-a3ddbb8a34e8> in <module>
----> 1 import brightway2 as bw
/opt/anaconda3/envs/bw2/lib/python3.6/site-packages/brightway2/__init__.py in <module>
1 # -*- coding: utf-8 -*
----> 2 from bw2data import *
3 from bw2calc import *
4 from bw2io import *
5
/opt/anaconda3/envs/bw2/lib/python3.6/site-packages/bw2data/__init__.py in <module>
31
32 from .configuration import config
---> 33 from .project import projects
34 from .utils import set_data_dir
35 from .meta import (
/opt/anaconda3/envs/bw2/lib/python3.6/site-packages/bw2data/project.py in <module>
6 from .errors import ReadOnlyProject
7 from .filesystem import safe_filename, create_dir
----> 8 from .sqlite import PickleField, create_database
9 from .utils import python_2_unicode_compatible
10 from fasteners import InterProcessLock
/opt/anaconda3/envs/bw2/lib/python3.6/site-packages/bw2data/sqlite.py in <module>
4
5 from peewee import SqliteDatabase, BlobField, Model, TextField
----> 6 from playhouse.shortcuts import RetryOperationalError
7 import os
8 try:
ImportError: cannot import name 'RetryOperationalError'
I am using macOS system. I have tried reinstalling conda as well but I keep getting the same error, so I am not sure what is wrong. Any help or suggestions would be greatly appreciated!
Your version of bw2data is very out of date. Since 2018, i.e. version 3.3, this code has changed. Upgrade bw2data using either conda or pip, depending on how you installed it in the first place.
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.
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
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.
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.