我在Max OS中安装了tensorflow + python,遵循网络上的一些资源。 env pameters:Mac OS 10.12 + python2.7 + tensorflow 0.5.0 当我尝试打开笔记本时,我发生了类似的错误:
****MacBook:code ****$ python
Python 2.7.12 (v2.7.12:d33e0cf91556, Jun 26 2016, 12:10:39)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ipython notebook
File "<stdin>", line 1
ipython notebook
^
SyntaxError: invalid syntax
>>> print ‘hello'
python[notebook])
当我检查该条款时,结果是:
****MacBook:****$ pip install --user ipython[notebook】
Requirement already satisfied: webencodings in
/Users/****/Library/Python/2.7/lib/python/site-packages (from
html5lib>=0.99999999->bleach->nbconvert->notebook; extra == "notebook”->ipython[notebook])
当我使用print命令时,结果为:
>>> print "hello"
hello
>>> print(hello)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'hello' is not defined
>>> print("hello")
hello
我找不到解决方案,你能给我任何有用的指导,非常感谢你。
答案 0 :(得分:0)
命令“ipython notebook”不在python REPL中执行,它在shell中执行。
****MacBook:code ****$ ipython notebook
会好的。