ModuleNotFoundError: No module named ‘tensorflow_examples’

Please make sure that this is a bug. As per our
GitHub Policy,
we only address code/doc bugs, performance issues, feature requests and
build/installation issues on GitHub. tag:bug_template

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): Just trying to import and check
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Win10
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: No
  • TensorFlow installed from (source or binary): pip with GPU support
  • TensorFlow version (use command below): 2.0.0
  • Python version: 3.5
  • Bazel version (if compiling from source): No
  • GCC/Compiler version (if compiling from source):No
  • CUDA/cuDNN version: Cuda compilation tools, release 10.1, V10.1.243(nvcc –version)
  • GPU model and memory: GeForce 920M

You can collect some of this information using our environment capture
script
You can also obtain the TensorFlow version with:

  1. TF 1.0: python -c "import tensorflow as tf; print(tf.GIT_VERSION, tf.VERSION)"
  2. TF 2.0: python -c "import tensorflow as tf; print(tf.version.GIT_VERSION, tf.version.VERSION)"

version – 2.0.0

Describe the current behavior

In my Notebook’s first cell, I wrote :

!pip install git+https://github.com/tensorflow/examples.git
!pip install -U tfds-nightly

On the next cell :

import tensorflow as tf
from tensorflow_examples.models.pix2pix import pix2pix

But it gives me : ModuleNotFoundError: No module named ‘tensorflow_examples’

Describe the expected behavior

It should have exported the module.

Standalone code to reproduce the issue
Provide a reproducible test case that is the bare minimum necessary to generate
the problem. If possible, please share a link to Colab/Jupyter/any notebook.

Other info / logs Include any logs or source code that would be helpful to
diagnose the problem. If including tracebacks, please include the full
traceback. Large logs and files should be attached.

Here is the pip install log :

Collecting git+https://github.com/tensorflow/examples.git
  Cloning https://github.com/tensorflow/examples.git to c:\users\mua\appdata\local\temp\pip-req-build-qtmqgj7m
Requirement already satisfied (use --upgrade to upgrade): tensorflow-examples===b30a40f9416fc38cfa91ca03d835ba1fc432a824- from git+https://github.com/tensorflow/examples.git in e:\software\python 3.5\lib\site-packages
Requirement already satisfied: absl-py in e:\software\python 3.5\lib\site-packages (from tensorflow-examples===b30a40f9416fc38cfa91ca03d835ba1fc432a824-) (0.8.1)
Requirement already satisfied: six in e:\software\python 3.5\lib\site-packages (from tensorflow-examples===b30a40f9416fc38cfa91ca03d835ba1fc432a824-) (1.14.0)
Building wheels for collected packages: tensorflow-examples
  Building wheel for tensorflow-examples (setup.py): started
  Building wheel for tensorflow-examples (setup.py): finished with status 'done'
  Created wheel for tensorflow-examples: filename=tensorflow_examples-b30a40f9416fc38cfa91ca03d835ba1fc432a824_-py3-none-any.whl size=136427 sha256=40d5b23f277f4634313116bf6205588e8668a499798fe1c7fdad143fc6144b68
  Stored in directory: C:\Users\MUA\AppData\Local\Temp\pip-ephem-wheel-cache-5wvvxv8d\wheels\e2\f1\08\a5d8eb62f62cc814d511a70115a5467b1135ec8270dd16d620
Successfully built tensorflow-examples
  Running command git clone -q https://github.com/tensorflow/examples.git 'C:\Users\MUA\AppData\Local\Temp\pip-req-build-qtmqgj7m'
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the 'e:\software\python 3.5\python.exe -m pip install --upgrade pip' command.
Collecting tfds-nightly
  Downloading tfds_nightly-3.2.1.dev202007220105-py3-none-any.whl (3.4 MB)
Requirement already satisfied, skipping upgrade: wrapt in e:\software\python 3.5\lib\site-packages (from tfds-nightly) (1.11.2)
Requirement already satisfied, skipping upgrade: numpy in e:\software\python 3.5\lib\site-packages (from tfds-nightly) (1.17.4)
Requirement already satisfied, skipping upgrade: tqdm in e:\software\python 3.5\lib\site-packages (from tfds-nightly) (4.45.0)
Collecting tensorflow-metadata
  Downloading tensorflow_metadata-0.23.0-py3-none-any.whl (43 kB)
Collecting promise
  Downloading promise-2.3.tar.gz (19 kB)
Collecting dill
  Downloading dill-0.3.2.zip (177 kB)
Requirement already satisfied, skipping upgrade: six in e:\software\python 3.5\lib\site-packages (from tfds-nightly) (1.14.0)
Collecting attrs>=18.1.0
  Downloading attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Requirement already satisfied, skipping upgrade: protobuf>=3.6.1 in e:\software\python 3.5\lib\site-packages (from tfds-nightly) (3.10.0)
Requirement already satisfied, skipping upgrade: absl-py in e:\software\python 3.5\lib\site-packages (from tfds-nightly) (0.8.1)
Requirement already satisfied, skipping upgrade: termcolor in e:\software\python 3.5\lib\site-packages (from tfds-nightly) (1.1.0)
Requirement already satisfied, skipping upgrade: requests>=2.19.0 in e:\software\python 3.5\lib\site-packages (from tfds-nightly) (2.23.0)
Collecting future
  Downloading future-0.18.2.tar.gz (829 kB)
Collecting googleapis-common-protos
  Downloading googleapis_common_protos-1.52.0-py2.py3-none-any.whl (100 kB)
Requirement already satisfied, skipping upgrade: setuptools in e:\software\python 3.5\lib\site-packages (from protobuf>=3.6.1->tfds-nightly) (41.6.0)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in e:\software\python 3.5\lib\site-packages (from requests>=2.19.0->tfds-nightly) (1.25.8)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in e:\software\python 3.5\lib\site-packages (from requests>=2.19.0->tfds-nightly) (2.9)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in e:\software\python 3.5\lib\site-packages (from requests>=2.19.0->tfds-nightly) (2019.11.28)
Requirement already satisfied, skipping upgrade: chardet<4,>=3.0.2 in e:\software\python 3.5\lib\site-packages (from requests>=2.19.0->tfds-nightly) (3.0.4)
Building wheels for collected packages: promise, dill, future
  Building wheel for promise (setup.py): started
  Building wheel for promise (setup.py): finished with status 'done'
  Created wheel for promise: filename=promise-2.3-py3-none-any.whl size=21498 sha256=82af1fb81258e76c2ddec82ec8870ec0901b560e2547ddff0f81e096cd65fdc2
  Stored in directory: c:\users\mua\appdata\local\pip\cache\wheels\b6\3e\4e\d80f74df03a8059f631b23ec49939d8fa0a2633522596b6ffd
  Building wheel for dill (setup.py): started
  Building wheel for dill (setup.py): finished with status 'done'
  Created wheel for dill: filename=dill-0.3.2-py3-none-any.whl size=78977 sha256=22a67eb861aca650bc9f1e039c15cb8ef9a87fbe88a139952868f352dd8f51aa
  Stored in directory: c:\users\mua\appdata\local\pip\cache\wheels\5c\4b\fd\db4143df7b4a4301b4068a2ed49f300b76b13d87b23bf375da
  Building wheel for future (setup.py): started
  Building wheel for future (setup.py): finished with status 'done'
  Created wheel for future: filename=future-0.18.2-py3-none-any.whl size=491061 sha256=f19a6fd742fd80f4a1995a132c1c10b6de14b112ef5110bcb31eff13a2379306
  Stored in directory: c:\users\mua\appdata\local\pip\cache\wheels\c4\f0\ae\d4689c4532d1f111462ed6a884a7767d502e511ee65f0d8e1b
Successfully built promise dill future
Installing collected packages: googleapis-common-protos, tensorflow-metadata, promise, dill, attrs, future, tfds-nightly
Successfully installed attrs-19.3.0 dill-0.3.2 future-0.18.2 googleapis-common-protos-1.52.0 promise-2.3 tensorflow-metadata-0.23.0 tfds-nightly-3.2.1.dev202007220105
WARNING: You are using pip version 20.1.1; however, version 20.2.2 is available.
You should consider upgrading via the 'e:\software\python 3.5\python.exe -m pip install --upgrade pip' command.

1 possible answer(s) on “ModuleNotFoundError: No module named ‘tensorflow_examples’