【发布时间】:2018-08-04 07:44:18
【问题描述】:
我正在尝试使用 tmux 运行深度学习程序。但是,似乎 tensorflow 不可用。
要启动我运行的 tmux 环境:
ubuntu@ip-xxx-xx-x-xx:~/xxxx/xxxx$ tmux
然后在我运行的tmux环境里面:
ubuntu@ip-xxx-xx-x-xx:~/xxxx/xxxx$ source activate tensorflow_p36
(tensorflow_p36) ubuntu@ip-xxx-xx-x-xx:~/xxxx/xxxx$ python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 18:10:19)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorflow'
导入 tensorflow 以外的其他包(例如 PIL 或 cv2)可以正常工作。在 tmux 环境之外导入 tensorflow 是可行的。
我在 ubuntu 16 AWS 服务器上运行它。可能是什么问题?
【问题讨论】:
-
您确定 tensorflow 已安装在您的虚拟环境中吗?
-
当您说虚拟环境时,您是指在 tmux 内部吗?在tmux之外导入tensorflow是没有问题的。
-
是的,请检查没有 tmux,
source activate tensorflow_p36我想这是您正在激活虚拟环境。 -
我明白了,你在终端输入 python 之前这样做了吗
source activate tensorflow_p36 -
运行 tmux 可能不会改变你的 python 版本,这与你的虚拟环境有关,它有 python 3.6.4
标签: python ubuntu tensorflow anaconda tmux