import hvplot.pandas
import hvplot.pandas
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-d0834c846347> in <module>
----> 1 import hvplot.pandas
~\anaconda3\envs\PythonData\lib\site-packages\hvplot\__init__.py in <module>
70 from .converter import HoloViewsConverter
71 from .interactive import Interactive
---> 72 from .ui import explorer # noqa
73 from .utilities import hvplot_extension, output, save, show # noqa
74 from .plotting import (hvPlot, hvPlotTabular, # noqa
~\anaconda3\envs\PythonData\lib\site-packages\hvplot\ui.py in <module>
7 from holoviews.element import tile_sources
8 from holoviews.plotting.util import list_cmaps
----> 9 from panel.viewable import Viewer
10
11 from .converter import HoloViewsConverter as _hvConverter
ImportError: cannot import name 'Viewer'
Uninstalled hvplot
uninstalled holoview
reinstalled - reboot - rerun same error
version hvplot0.8.1
version holoview 1.14.9
install and uninstalls successfull everytime
Any ideas
It is likely that the version of Panel you got installed is one that is pretty old. If you still encounter this issue you should try forcing a recent Panel version with pip/conda install hvplot panel>=0.14.
Related
When trying to load BERT QA I get the following ImportError:
"Cannot import name 'network' from 'tensorflow.python.keras.engine'"
The full error log follows below
Following this post,
ImportError: cannot import name 'network' from 'tensorflow.python.keras.engine'
I have tried the following steps,
pip uninstall tf-agents
pip install tf-agents-nightly
and then in Python,
from tf_agents.environments import suite_gym
However, this did not resolve the problem. Any suggestions would be very welcome!
In case it is helpful, I'm running TensorFlow version 2.3.0. Also, the script init.py referred to below does exist, however the file is empty, i.e. 0 bytes.
ImportError Traceback (most recent call last)
<ipython-input-2-323bac0cb5ba> in <module>
----> 1 from bert_qa import squad
~/anaconda3/lib/python3.8/site-packages/bert_qa/squad.py in <module>
34 from . import model_training_utils
35 from . import bert_modeling as modeling
---> 36 from . import bert_models
37 from . import optimization
38 from . import input_pipeline
~/anaconda3/lib/python3.8/site-packages/bert_qa/bert_models.py in <module>
25 from . import bert_modeling
26 from . import weighted_sparse_categorical_crossentropy
---> 27 from . transformer_encoder import TransformerEncoder
28 from . albert_transformer_encoder import AlbertTransformerEncoder
29 from . import bert_classifier
~/anaconda3/lib/python3.8/site-packages/bert_qa/transformer_encoder.py in <module>
22 import tensorflow as tf
23
---> 24 from tensorflow.python.keras.engine import network # pylint: disable=g-direct-tensorflow-import
25
26 from . import activations
ImportError: cannot import name 'network' from 'tensorflow.python.keras.engine' (/home/user810643/anaconda3/lib/python3.8/site-packages/tensorflow/python/keras/engine/__init__.py)
Install tf-agents 0.6.0 version for Tebsorflow 2.3.
pip install tf-agents==0.6.0
Looks like the issue was caused due to TF-Agents and Tensorflow version incompatibility. For more information, please take a look at this release notes. Thanks!
I installed the latest anaconda navigator 1.9.7 (windows 10), and created a new env (python 3.7)in the anaconda navigator interface, then installed jupyter notebook and tensorflow 2.0 package in it.
when I tried to import tensorflow as follow
import tensorflow as tf
I got this error
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-64156d691fe5> in <module>
----> 1 import tensorflow as tf
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\__init__.py in <module>
26
27 # pylint: disable=g-bad-import-order
---> 28 from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
29 from tensorflow.python.tools import module_util as _module_util
30
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\__init__.py in <module>
47 import numpy as np
48
---> 49 from tensorflow.python import pywrap_tensorflow
50
51 # Protocol buffers
~\AppData\Roaming\Python\Python37\site-packages\tensorflow\python\pywrap_tensorflow.py in <module>
23 import traceback
24
---> 25 from tensorflow.python.platform import self_check
26
27
ModuleNotFoundError: No module named 'tensorflow.python.platform'
i tried use
pip uninstall tensorflow
pip install tensorflow
and
redid it inside that directory
nothing worked so far.
any suggestion?
If you clone from git ,you can
just change the folder from the one where you run the configure/bazel and then try python import tensorflow as tf
I'm trying to import sklearn model_selection but I'm getting the following error:
ImportError Traceback (most recent call last)
<ipython-input-219-6bc6f0a77ca9> in <module>()
----> 1 import sklearn.model_selection
~/anaconda3/lib/python3.6/site-packages/sklearn/model_selection/__init__.py in <module>()
----> 1 from ._split import BaseCrossValidator
2 from ._split import KFold
3 from ._split import GroupKFold
4 from ._split import StratifiedKFold
5 from ._split import TimeSeriesSplit
~/anaconda3/lib/python3.6/site-packages/sklearn/model_selection/_split.py in <module>()
21
22 from ..utils import indexable, check_random_state, safe_indexing
---> 23 from ..utils import _approximate_mode
24 from ..utils.validation import _num_samples, column_or_1d
25 from ..utils.validation import check_array
ImportError: cannot import name '_approximate_mode'
I tried uninstalling scikit-learn and reinstalling it but I get the same error. My current version of scikit-learn is 0.21.2.
Thanks for the help!
I shutdown the kernel and restarted it again. Now it's working fine! Thanks!!
You are using python notebook. I found that error once when I have installed the package before importing. I have tested this at Google AI notebook and worked well.
Save the notebook -> shutdown the kernel -> close and open the notebook again.
You can restart the kernel or use the importlib library
from importlib import reload
sklearn= reload(sklearn)
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build\__init__.py in <module>()
43 try:
---> 44 from ._check_build import check_build # noqa
45 except ImportError as e:
ModuleNotFoundError: No module named
'sklearn.__check_build._check_build'
During handling of the above exception, another exception occurred:
ImportError Traceback (most recent call last)
<ipython-input-1-f14d678f34eb> in <module>()
1 from keras.models import Sequential
2 from keras.layers import Dense, Dropout
----> 3 from sklearn.model_selection import train_test_split
4 import numpy
5 import pandas as pd
~\AppData\Roaming\Python\Python36\site-packages\sklearn\__init__.py in <module>()
61 # process, as it may not be compiled yet
62 else:
---> 63 from . import __check_build
64 from .base import clone
65 from .utils._show_versions import show_versions
~\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build\__init__.py in <module>()
44 from ._check_build import check_build # noqa
45 except ImportError as e:
---> 46 raise_build_error(e)
~\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build\__init__.py in raise_build_error(e)
39 to build the package before using it: run `python setup.py install` or
40 `make` in the source directory.
---> 41 %s""" % (e, local_dir, ''.join(dir_content).strip(), msg))
42
43 try:
ImportError: No module named 'sklearn.__check_build._check_build'
Contents of C:\Users\owaisaaa\AppData\Roaming\Python\Python36\site-packages\sklearn\__check_build:
setup.py _check_build.cp36-win32.pyd__init__.py
__pycache__
It seems that scikit-learn has not been built correctly.
If you have installed scikit-learn from source, please do not forget
to build the package before using it: run python setup.py install or
make in the source directory.
If you have used an installer, please check that it is suited for your
Python version, your operating system and your platform.
I recently used the pycharm on the same machine and downloaded the packages in it. From that moment onward I am getting the above mentioned error in my jupyter notebook.
Try installing scipy and restarting python shell
Upgrading scikit-learn worked for me:
$ pip install --upgrade scikit-learn
importing pytables (3.1.1) in python 3.4.1 fails for me, complaining about a failed cPickle import
i try to use potables (3.1.1) with python (3.4.1)
In [1]: import tables
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-389ecae14f10> in <module>()
----> 1 import tables
/work/projects/vEnv/lib/python3.4/site-packages/tables/__init__.py in <module>()
80
81 # Necessary imports to get versions stored on the cython extension
---> 82 from tables.utilsextension import (
83 get_pytables_version, get_hdf5_version, blosc_compressor_list,
84 blosc_compcode_to_compname_ as blosc_compcode_to_compname,
/work/projects/vEnv/lib/python3.4/site-packages/tables/utilsextension.pyx in init tables.utilsextension (tables/utilsextension.c:15600)()
/work/projects/vEnv/lib/python3.4/site-packages/tables/description.py in <module>()
22 import numpy
23
---> 24 from tables import atom
25 from tables.path import check_name_validity
26
/work/projects/vEnv/lib/python3.4/site-packages/tables/atom.py in <module>()
18 import sys
19 import inspect
---> 20 import cPickle
21
22 import numpy
As i understand cPickle is only used instead of pickle in python2.
As of PyTable 3.x it should work fine with python3.x. How can there be a cPickle import than?
What do i have to do to use pytables with python3?
The error was produced most likely due to a problem with my vEnv. Uninstalling the package and reinstalling it fix the problem.
See github issue