from tensorflow.keras.preprocessing.text import Tokenizer
ImportError: No module named keras.preprocessing.text
Any solution?
thank you
my operating system: Ubuntu 19.10
Upgrade your keras package to latest version with command
pip install -U pip keras tensorflow
Related
I have tensorflow 1.9.0 and after successful installation of bert using !pip install bert-tensorflow, I cannot import bert in Jupyter notebook. I even ran !pip install bert-for-tf2. Still no success.
It turns out I did not have tensorflow in my environment. Fixed after installing tensorflow.
seems like "import tensorflow as tf" directly raise this error
Colab link:https://colab.research.google.com/drive/1Jr0j_I_npKQxcQ1ggJQFHTqoJHmt9Bqk
sorry, the problem is that installing tensorflow-gpu does not uninstall tensorflow and tensorflow 2.2.0 has introduced some changes that are incompatible with tensorflow 1.14.0.
if you do
%tensorflow_version 2.x
!pip uninstall -y tensorflow
!pip install tensorflow-gpu==1.14.0
it will work
I use:
tensorflow 2.0.0-beta1
tflearn 0.3.2
I get: ModuleNotFoundError: No module named 'tensorflow.contrib'
Which recent version of tf/tflearn are compatible?
I reinstalled tensorflow and it somehow worked
pip install --upgrade --force-reinstall tensorflow
With Python3.5, I try to use the 'tensorflow' module:
import tensorflow as tf
But.. it says No mudule named tensorflow
I just tried to download the module with pip3:
pip3 install --upgrade tensorflow-gpu
(I have all the requirements to run tensorflow with GPU support as described at tensorflow.org)
I've seen a similar question here ImportError: No module named tensorflow , here's a sum up of what's inside:
Make sure installation is correct via:
pip3 show tensorflow
You can optionally re-install it again using: pip install tensorflow==1.2.0 --ignore-installed
Make sure you're running the python code with Python 3.x, verify using: python --version
Make sure you install TF and run the script through the same user, avoid installing TF using sudo pip install... and running the code with python script.py
I ran the following on my Anaconda command prompt for python 3.6:
pip install keras
Next, typing the following on Spyder:
import keras
The above gives me an error:
No module named 'tensorflow'
Tring to do pip install tensorflow on the Anaconda command prompt gives me the follwing error:
No matching distribution found for tensorflow
To install a module into anaconda, use
$ conda install tensorflow
The command that you ran
$ pip install tensorflow
will not install it inside the anaconda virtualenv for python.
If you try
$ python
>>> import keras
This will work after pip install tensorflow. However, use conda package manager to install modules to anaconda.