我在运行我的iPython笔记本时遇到以下错误,并且想知道是否有人可以提供帮助.
我曾尝试浏览以前的帖子,但找不到答案.noteboook最终在Web浏览器上运行,但错误仍然出现.
控制台出错:
C:\Apps\Anaconda2\envs\simpleQT\python.exe C:\Apps\Anaconda2\envs\simpleQT\Scripts\ipython-script.py notebook --no-browser --ip 127.0.0.1 --port 8888 [I 09:43:20.525 NotebookApp] The port 8888 is already in use, trying another random port. [I 09:43:20.528 NotebookApp] Serving notebooks from local directory: C:\Users\Tanya.Sandoval\_QT\simpleQT [I 09:43:20.528 NotebookApp] 0 active kernels [I 09:43:20.528 NotebookApp] The IPython Notebook is running at: http://127.0.0.1:8889/ [I 09:43:20.528 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [E 09:43:37.553 NotebookApp] Notebook JSON is invalid: u'execution_count' is a required property Failed validating u'required' in schema: {u'additionalProperties': False, u'description': u'Result of executing a code cell.', u'properties': {u'data': {u'$ref': u'#/definitions/misc/mimebundle'}, u'execution_count': {u'description': u"A result's prompt number.", u'minimum': 0, u'type': [u'integer', u'null']}, u'metadata': {u'$ref': u'#/definitions/misc/output_metadata'}, u'output_type': {u'description': u'Type of cell output.', u'enum': [u'execute_result']}}, u'required': [u'output_type', u'data', u'metadata', u'execution_count'], u'type': u'object'} On instance: {u'data': {u'text/html': u'\n'}, u'metadata': {}, u'output_type': u'execute_result'} [W 09:43:37.565 NotebookApp] Notebook notebook.ipynb is not trusted [I 09:43:38.515 NotebookApp] Kernel started: c8c37658-b072-4a1d-87c5-0f862f514e44\n \n
\n\n \n\n Open \nHigh \nLow \nClose \nVolume \n\n \n \n \nTimestamp \n\n \n \n \n \n \n \n2009-01-02 \n15.90 \n15.95 \n15.30 \n15.55 \n1065 \n\n \n2009-01-05 \n15.94 \n15.94 \n15.32 \n15.38 \n3710 \n\n \n2009-01-06 \n15.60 \n15.90 \n15.43 \n15.69 \n4619 \n\n \n2009-01-07 \n15.75 \n16.04 \n15.40 \n15.45 \n5956 \n\n \n2009-01-08 \n15.40 \n15.45 \n14.49 \n14.76 \n8454 \n\n \n2009-01-09 \n14.60 \n14.80 \n14.40 \n14.44 \n6846 \n\n \n2009-01-12 \n14.40 \n14.40 \n13.70 \n13.94 \n10355 \n\n \n2009-01-13 \n13.30 \n14.05 \n13.30 \n13.78 \n11341 \n\n \n2009-01-14 \n13.90 \n14.25 \n13.20 \n13.28 \n11170 \n\n \n \n2009-01-15 \n13.17 \n13.64 \n13.07 \n13.25 \n9745 \n
Web浏览器出错:
Notebook Validation failed: u'execution_count' is a required property: { "output_type": "execute_result", "data": { "text/html": "\n" }, "metadata": {} }\n \n
\n\n \n\n Open \nHigh \nLow \nClose \nVolume \n\n \n \n \nTimestamp \n\n \n \n \n \n \n \n2009-01-02 \n15.90 \n15.95 \n15.30 \n15.55 \n1065 \n\n \n2009-01-05 \n15.94 \n15.94 \n15.32 \n15.38 \n3710 \n\n \n2009-01-06 \n15.60 \n15.90 \n15.43 \n15.69 \n4619 \n\n \n2009-01-07 \n15.75 \n16.04 \n15.40 \n15.45 \n5956 \n\n \n2009-01-08 \n15.40 \n15.45 \n14.49 \n14.76 \n8454 \n\n \n2009-01-09 \n14.60 \n14.80 \n14.40 \n14.44 \n6846 \n\n \n2009-01-12 \n14.40 \n14.40 \n13.70 \n13.94 \n10355 \n\n \n2009-01-13 \n13.30 \n14.05 \n13.30 \n13.78 \n11341 \n\n \n2009-01-14 \n13.90 \n14.25 \n13.20 \n13.28 \n11170 \n\n \n \n2009-01-15 \n13.17 \n13.64 \n13.07 \n13.25 \n9745 \n
有任何想法吗?谢谢!
更新
实际上这个错误只发生在我从PyCharm编辑器运行jupyter/ipython笔记本时.如果我在网络浏览器上运行它,错误就会消失.看起来PyCharm的笔记本兼容性仍然存在问题......
在笔记本上使用PyCharm后我遇到了同样的问题.
我可以通过简单地重新启动内核,清除所有输出并保存笔记本来使错误消失在浏览器中.
(内核/重启和清除输出)