我目前正在学习代码,并且在使用python中的Jupyter时遇到了麻烦。
我用Python3.10,我升级了pip,模块在良好的PATH中,并且我导入了jupyter。
我尝试在解释器中以两种不同的方式打开笔记本:
#Input1
>>> jupyter notebook
#Output1
File "<stdin>", line 1
jupyter notebook
^^^^^^^^
SyntaxError: invalid syntax
#Input2
>>> py -3.9 -m jupyter notebook
#Output2
File "<stdin>", line 1
py -3.9 -m jupyter notebook
^^^^^^^
SyntaxError: invalid syntax
我也在终端上做了,以防万一...但是我遇到了其他错误(翻译自FR):
jupyter-notebook: The term "jupyter-notebook" is not recognized as a name
cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path exists, verify that the
path is correct and try again.
To Line:1 character : 1
你知道发生了什么吗?
祝你有美好的一天!
看起来你在窗户上。
您应该在终端(而不是 python 提示符)中运行py -m jupyter notebook
。
如果这不起作用,请检查您是否使用py -m pip install notebook
安装了jupyter-notebook
。
另外,如果您使用的是python 3.10
,则不应运行py -3.9
我的jupyter笔记本在安装和调用CMD后无法正常工作。
然后我只在命令提示符(cmd)中使用"pip install simplejson"。然后我写"jupyter notebook",它起作用了!
有人在"pip install simplejson"之前使用"pip uninstall simplejson"。