[英]I can import tensorflow on python terminal but if i tried to run my py file i cant
When i use python in terminal;当我在终端中使用 python 时;
pi@raspberrypi:~ $ python
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
2020-07-26 12:52:03.075590: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory
>>>
But i tried run my py file但我尝试运行我的 py 文件
pi@raspberrypi:~ $ sudo python /home/pi/tfdeneme.py
pygame 1.9.4.post1
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "/home/pi/tfdeneme.py", line 17, in <module>
import tensorflow
ModuleNotFoundError: No module named 'tensorflow'
Im using tensorflow 2.2.0 on my windows machine, on raspberry pi tensorflow version =我在我的 windows 机器上,在树莓派 tensorflow 版本上使用 tensorflow 2.2.0 =
pi@raspberrypi:~ $ python
Python 3.7.3 (default, Dec 20 2019, 18:57:59)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
2020-07-26 12:53:49.504578: E tensorflow/core/platform/hadoop/hadoop_file_system.cc:132] HadoopFileSystem load error: libhdfs.so: cannot open shared object file: No such file or directory
>>> tf.__version__
'1.14.0'
Whay should i do to run my py file?我应该怎么做才能运行我的 py 文件?
I was having issues with TF 2.2.0 with python 3.7 and hence downgraded to python 3.6 and now it seems to be working.我在使用 python 3.7 的 TF 2.2.0 时遇到问题,因此降级到 python 3.6,现在它似乎正在工作。 Please note i am on a Mac though
请注意我在Mac上
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.