0
votes

Problem: Jupyter says "Module not found" when I try to import Tensorflow on Mac.

Background:

  • Virtualenv 16.7.9 installed & activated (venv)
  • Python 3.7.6 installed
  • PIP 19.3.1 installed
  • Tensorflow 2.1.0 installed using PIP as per official install instructions

At the command line, I can activate venv, start python3 then import tensorflow and display the tensorflow version correctly. But Tensorflow won't import from within Jupiter. And if I try to change the kernel within a Jupyter notebook, only Python3 is listed.

On other threads, people recommend using anaconda, but I've used PIP to install Tensorflow as recommended in the above link.

Any ideas?

1

1 Answers

1
votes

Install a Jupyter Kernel

You need to install a kernel inside the env and then use Jupyter.

ipython kernel install --user --name=.venv

Then restart jupyter, click new, you should see .venv in your kernel list.