【发布时间】:2018-06-01 03:35:59
【问题描述】:
我在 mac osx yosemite 上,Spyder 给我这个错误:
ImportError: 没有名为“tensorflow”的模块
我在虚拟环境中运行 python3.5 以及 tensorflow 1.0.0
代码:
import numpy as np
import tensorflow as tf
import re
import time
追溯:
Python 3.5.4 |Anaconda, Inc.| (default, Oct 5 2017, 02:58:14)
Type "copyright", "credits" or "license" for more information.
IPython 6.1.0 -- An enhanced Interactive Python.
Traceback (most recent call last):
File "<ipython-input-1-c6f06aebce6b>", line 1, in <module>
runfile('/Users/connorwoodford/Desktop/Deep NLP A-Z/chatbot.py', wdir='/Users/connorwoodford/Desktop/Deep NLP A-Z')
File "/Users/connorwoodford/anaconda3/envs/chatbot/lib/python3.5/site-packages/spyder/utils/site/sitecustomize.py", line 710, in runfile
execfile(filename, namespace)
File "/Users/connorwoodford/anaconda3/envs/chatbot/lib/python3.5/site-packages/spyder/utils/site/sitecustomize.py", line 101, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/Users/connorwoodford/Desktop/Deep NLP A-Z/chatbot.py", line 7, in <module>
import tensorflow as tf
ImportError: No module named 'tensorflow'
【问题讨论】:
-
您能提供您尝试执行的代码和整个回溯吗?
-
请查看我在回答中提供的一些建议,并就它们是否有帮助提供一些反馈。
标签: python macos tensorflow spyder osx-yosemite