devguide icon indicating copy to clipboard operation
devguide copied to clipboard

Group of commands running in Python 3.7.6 Shell, but failing as Script file.

Open rosarion opened this issue 5 years ago • 0 comments

Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information.

from future import absolute_import, division, print_function, unicode_literals import numpy as np import matplotlib.pyplot as plt import tensorflow as tf from tensorflow import keras print(tf.version) 2.1.0

BUT IF I RUN THESE COMMANDS as a PYTHON SCRIPT FILE iy FAILS. ======================== RESTART: D:\PythonCode-1\tmp.py ======================= Traceback (most recent call last): File "D:\PythonCode-1\tmp.py", line 7, in import tensorflow as tf File "C:\Python37\lib\site-packages\tensorflow_init_.py", line 101, in from tensorflow_core import * File "C:\Python37\lib\site-packages\tensorflow_core_init_.py", line 40, in from tensorflow.python.tools import module_util as _module_util ModuleNotFoundError: No module named 'tensorflow.python.tools'; 'tensorflow.python' is not a package

Why is it failing as a Script file ? Is there something wrong in my Procedure ?

Hope to teceive your reply and Thanks in Advanced.

rosarion avatar Mar 16 '20 06:03 rosarion