【问题标题】:Cannot create Jupyter Notebook in HDInsight 4.0无法在 HDInsight 4.0 中创建 Jupyter Notebook
【发布时间】:2020-01-30 22:23:07
【问题描述】:

我正在使用 Azure HDInsight 4.0 (Spark 2.4)。当我尝试创建新的 Jupyter 笔记本(Spark,但 PySpark 笔记本出现类似错误)时,我收到以下错误消息:

Traceback (most recent call last): File "/usr/bin/anaconda/lib/python2.7/site-packages/notebook/base/handlers.py", line 457, in wrapper result = yield gen.maybe_future(method(self, *args, **kwargs)) File "/usr/bin/anaconda/lib/python2.7/site-packages/tornado/gen.py", line 1015, in run value = future.result() File "/usr/bin/anaconda/lib/python2.7/site-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "/usr/bin/anaconda/lib/python2.7/site-packages/tornado/gen.py", line 1021, in run yielded = self.gen.throw(*exc_info) File "/usr/bin/anaconda/lib/python2.7/site-packages/notebook/services/contents/handlers.py", line 216, in post yield self._new_untitled(path, type=type, ext=ext) File "/usr/bin/anaconda/lib/python2.7/site-packages/tornado/gen.py", line 1015, in run value = future.result() File "/usr/bin/anaconda/lib/python2.7/site-packages/tornado/concurrent.py", line 237, in result raise_exc_info(self._exc_info) File "/usr/bin/anaconda/lib/python2.7/site-packages/tornado/gen.py", line 285, in wrapper yielded = next(result) File "/usr/bin/anaconda/lib/python2.7/site-packages/notebook/services/contents/handlers.py", line 171, in _new_untitled model = yield gen.maybe_future(self.contents_manager.new_untitled(path=path, type=type, ext=ext)) File "/usr/bin/anaconda/lib/python2.7/site-packages/notebook/services/contents/manager.py", line 338, in new_untitled return self.new(model, path) File "/usr/bin/anaconda/lib/python2.7/site-packages/notebook/services/contents/manager.py", line 364, in new model = self.save(model, path) File "/var/lib/.jupyter/jupyterazure/jupyterazure/httpfscontentsmanager.py", line 84, in save self.create_checkpoint(path) File "/usr/bin/anaconda/lib/python2.7/site-packages/notebook/services/contents/manager.py", line 459, in create_checkpoint return self.checkpoints.create_checkpoint(self, path) File "/usr/bin/anaconda/lib/python2.7/site-packages/notebook/services/contents/checkpoints.py", line 79, in create_checkpoint model = contents_mgr.get(path, content=True) File "/var/lib/.jupyter/jupyterazure/jupyterazure/httpfscontentsmanager.py", line 56, in get 'metadata': {}}) File "/var/lib/.jupyter/jupyterazure/jupyterazure/model.py", line 45, in create_model_from_blob nbformat.version_info[0]) File "/usr/bin/anaconda/lib/python2.7/site-packages/nbformat/__init__.py", line 75, in reads nb = convert(nb, as_version) File "/usr/bin/anaconda/lib/python2.7/site-packages/nbformat/converter.py", line 54, in convert "version doesn't exist" % (to_version)) ValueError: Cannot convert notebook to v5 because that version doesn't exist

在此之后,一个新的笔记本确实出现在主屏幕上,但如果我尝试打开它,我会收到以下弹出消息:

An unknown error occurred while loading this notebook. This version can load notebook formats v4 or earlier. See the server log for details.

我可以在其他完全相同的 HDI 3.6 集群上创建笔记本,但不能在 4.0 上创建。 (我需要 4.0,因为我需要使用 Spark 2.4。)

以前有没有人经历过/解决过这个问题?

【问题讨论】:

    标签: apache-spark jupyter-notebook azure-hdinsight


    【解决方案1】:

    最近,我们在同一问题上看到了几个问题。您可以按照以下步骤解决问题。

    解决此问题的步骤:

    步骤一:通过ssh连接headnode,修改文件内容-/usr/bin/anaconda/lib/python2.7/site-packages/nbformat/_version.py,将5替换为4

    把这个改成:

    version_info = (4, 0, 3)

    第二步:通过 Ambari 重启 Jupyter 服务。

    更多详情请参考HDInshight Create not create Jupyter notebook

    希望这会有所帮助。如果您有任何进一步的疑问,请告诉我们。

    【讨论】:

    • 成功了,谢谢!很高兴看到它现在在文档中。
    • 此问题现已在 Azure HDI 服务中得到修复,因此您应该不会再看到该错误。
    猜你喜欢
    • 1970-01-01
    • 2016-05-24
    • 2020-11-04
    • 2021-02-09
    • 1970-01-01
    • 2019-04-11
    • 2023-02-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多