我正在尝试在python3.5和虚拟环境中导入TensorFlow模块。我以前在虚拟环境中安装了它。但是,当我尝试导入-“将TensorFlow作为tf导入”时,出现错误。
我尝试安装enum34模块。它说:“已经满足要求:/usr/local/lib/python2.7/dist-packages(1.1.6)中的enum34”。我仍然无法导入TensorFlow模块。
我希望模块可以成功导入,但是在尝试导入TensorFlow时出现以下错误
>>>import tensorflow as tf
0 5
1 6
2 7
3 8
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'tensorflow'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 63, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python3/dist-packages/apport/__init__.py", line 5, in <module>
from apport.report import Report
File "/usr/lib/python3/dist-packages/apport/report.py", line 12, in <module>
import subprocess, tempfile, os.path, re, pwd, grp, os, time
File "/usr/lib/python3.5/subprocess.py", line 364, in <module>
import signal
File "/usr/lib/python3.5/signal.py", line 4, in <module>
from enum import IntEnum as _IntEnum
ImportError: cannot import name 'IntEnum'
Original exception `enter code here`was:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'tensorflow'