No module named 'tensorflow_datasets' error
Dear 365 Data Science Team,
Please check on the below error when I try to run tensorflow datasets even though I did install the below already, your quick response is highly appreciated
1-pip install tensorflow_datasets "Already satisfied"
2-pip install tensorflow-datasets "Already satisfied"
3-pip install tensorflow datasets "Already satisfied"
4-pip install ipykernel "Already satisfied"
CodeMarkdownRaw NBConvertHeading-
import tensorflow as tf
import tensorflow_datasets as tfds
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_28644\8218867.py in <module>
1 import tensorflow as tf
----> 2 import tensorflow_datasets as tfds
ModuleNotFoundError: No module named 'tensorflow_datasets'
Thanks,
Mohammad.
If you are directly installing via conda, it is best to set up conda-forge as all the packages are shared in a single channel.Importantly the corresponding builds for AMD,Linux and MacOS are also up-to-date. For installing , here are the steps:
Making sure conda version is >=4.9:
conda --version
conda update conda
Adding conda-forge as the highest priority channel:
conda config --add channels conda-forge
Activate Strict priority (optional for Conda>=5.0):
conda config --set channel_priority strict
Install the tensorflow-datasets package from conda-forge:
conda install tensorflow-datasets==4.3.0
4.3.0 is the latest version as per Pypi.
To use tensorflow datasets, open the terminal/command prompt and enter :
pip install tensorflow_datasets
And if you are using Anaconda, you need to open up your environment and then manually import it as it doesn't gets installed.
If you are using Anaconda, go to Anaconda Navigator -> Environments -> Choose your environment. After that simply find which package would you like to install and click it. After you accept it, it uploads automatically. It is really easy. (It took half an hour to find a correct answer for me, but after finding in Anaconda it is way easier than using Terminal) Do not forget to restart Anaconda after installing new packages.
Hello Rajan,
Thank you for your reply but when I type conda install tensorflow-datasets==4.3.0 in the virtual environment
it is showing the below error after it tries to download it
Package async-timeout conflicts for:
aiohttp -> async-timeout[version='<4.0,>=3.0|<5.0,>=4.0.0a3|>=3.0,<4.0|>=1.2,<3.0|>=1.2.0|>=4.0.0a3,<5.0']
google-auth -> aiohttp[version='>=3.6.2,<4.0.0dev'] -> async-timeout[version='<4.0,>=3.0|<5.0,>=4.0.0a3|>=3.0,<4.0|>=4.0.0a3,<5.0|>=1.2,<3.0|>=1.2.0']The following specifications were found to be incompatible with your system:
- feature:/win-64::__win==0=0
- feature:|@/win-64::__win==0=0
- click -> __unix
- click -> __win
- google-auth-oauthlib -> click[version='>=6.0.0'] -> __unix
- google-auth-oauthlib -> click[version='>=6.0.0'] -> __win
- ipykernel -> __linux
- ipykernel -> __win
- ipython -> __linux
- ipython -> __win
- ipywidgets -> ipykernel[version='>=4.5.1'] -> __linux
- ipywidgets -> ipykernel[version='>=4.5.1'] -> __win
- jupyter -> ipykernel -> __linux
- jupyter -> ipykernel -> __win
- jupyter_console -> ipykernel -> __linux
- jupyter_console -> ipykernel -> __win
- jupyter_server -> terminado[version='>=0.8.3'] -> __linux
- jupyter_server -> terminado[version='>=0.8.3'] -> __win
- jupyterlab -> ipython -> __linux
- jupyterlab -> ipython -> __win
- matplotlib-inline -> ipython -> __linux
- matplotlib-inline -> ipython -> __win
- nbclassic -> ipykernel -> __linux
- nbclassic -> ipykernel -> __win
- notebook -> ipykernel -> __linux
- notebook -> ipykernel -> __win
- pysocks -> __unix
- pysocks -> __win
- qtconsole -> ipykernel[version='>=4.1'] -> __linux
- qtconsole -> ipykernel[version='>=4.1'] -> __win
- setuptools -> wincertstore[version='>=0.2'] -> __win
- terminado -> __linux
- terminado -> __win
- urllib3 -> pysocks[version='>=1.5.6,<2.0,!=1.5.7'] -> __unix
- urllib3 -> pysocks[version='>=1.5.6,<2.0,!=1.5.7'] -> __win
- widgetsnbextension -> ipykernel[version='>=4.5.1'] -> __linux
- widgetsnbextension -> ipykernel[version='>=4.5.1'] -> __osx
- widgetsnbextension -> ipykernel[version='>=4.5.1'] -> __win
- win_inet_pton -> __win
- wincertstore -> __win
Your installed version is: not available
Note that strict channel priority may have removed packages required for satisfiability.
Regards,
Mohammad.
Once reinstall the virtual environments along with the libraries
there may be issue when you created the virtual environment it's didn't got properly sync
Request quick clarification,
I'm willing to use TF in different environment so shall I apply the above commands you shared to the base environment also or in the environment I will be using tensorflow in?
Try in any
if it's solving your problem it's sufficient