Unable to initialize Tensorflow in shell

Hi Sandeep, Abhinav,
I was going through this CloudXLab blog https://cloudxlab.com/blog/tensorflow-getting-started/
but I’m facing below issue while initializing TF.

  1. Opened python shell by simply typing ‘python’ in shell - successful

  2. Next, I ran the command ‘import tensorflow as tf’ and console reported below error
    >>> import tensorflow as tf
    Traceback (most recent call last):
    _ File “”, line 1, in _
    ImportError: No module named tensorflow

please let me know what am I missing.

Thanks & Regards,
Manoj
Chennai
+91 9003117220

Hi @ManojKumar,

Please access the tensorflow from Jupyter or launch the Python3 shell to access tensorflow.

Hope this helps.

Thanks

Thanks for the solution team :slight_smile:

for others with same query:

  1. click ‘Jupyter’ from Lab home page and you can create ‘New’ python3 notebook & start working on Tensorflow.

  2. in web console(shell) type below command (in italics) and it will open python3 shell where you can work on tensorflow

[manojpurohit17834325@ip-172-31-38-146 ~]$ /usr/local/anaconda/bin/python3
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import tensorflow as tf
/usr/local/anaconda/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of i
ssubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).typ e.
from ._conv import register_converters as _register_converters

1 Like