无法在 HDInsight 4.0 中创建 Jupyter Notebook

Cannot create Jupyter Notebook in HDInsight 4.0

我正在使用 Azure HDInsight 4.0 (Spark 2.4)。当我尝试创建一个新的 Jupyter notebook(Spark,但我在 PySpark notebooks 上遇到类似的错误)时,我收到以下错误消息:

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。)

以前有人experienced/resolved这个吗?

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

解决此问题的步骤:

Step1:通过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

希望这对您有所帮助。如果您有任何疑问,请告诉我们。