如何在Jupyter IPython Notebook中安装Scala? [英] How do I install Scala in Jupyter IPython Notebook?

查看:924
本文介绍了如何在Jupyter IPython Notebook中安装Scala?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我访问过的几个链接,它们的内容与他们说的完全一样.我不知道我在做什么错.

Here's a few links that I went to and did exactly what they said. I don't know what I'm doing wrong.

https://github.com/alexarchambault/jupyter-scala
https://github.com/ipython/ipython/wiki/IPython内核用于其他语言
https://github.com/apache/incubator-toree
http://jcrudy.github.io/blog/html/2013/12/08/introduction_to_iscala.html

https://github.com/alexarchambault/jupyter-scala
https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages
https://github.com/apache/incubator-toree
http://jcrudy.github.io/blog/html/2013/12/08/introduction_to_iscala.html

这些都不起作用.可以通过某种方式配置我的节点.我只是不知道请帮忙.

None of this is working. It may be some way that my node is configured. I just don't know. Please help.

推荐答案

您可以使用

确保已安装IPython 3. ipython --version应该返回一个 值> = 3.0.如果不是这种情况,请快速进行设置 包括安装Anaconda Python发行版,然后 正在运行

Ensure you have IPython 3 installed. ipython --version should return a value >= 3.0. If it's not the case, a quick way of setting it up consists in installing the Anaconda Python distribution, and then running

$ pip install --upgrade "ipython[all]"

ipython --version然后应返回> = 3.0的值.

ipython --version should then return a value >= 3.0.

下载适用于Scala 2.10的Jupyter Scala二进制文件(

Download the Jupyter Scala binaries for Scala 2.10 (txz or zip) or Scala 2.11 (txz or zip), and unpack them in a safe place. Then run once the jupyter-scala program (or jupyter-scala.bat on Windows) it contains. That will set-up the Jupyter Scala kernel for the current user.

通过运行来检查Jupyter/IPython是否了解Jupyter Scala

Check that Jupyter/IPython knows about Jupyter Scala by running

$ jupyter kernelspec list

这应该打印一行,例如

scala211

(或scala210取决于您选择的Scala版本).

(or scala210 dependending on the Scala version you chose).

然后使用以下任一命令运行IPython控制台

Then run either IPython console with

$ ipython console --kernel scala211

并立即开始使用Jupyter Scala内核,或运行Jupyter 笔记本电脑

and start using the Jupyter Scala kernel straightaway, or run Jupyter Notebook with

$ jupyter notebook

并通过在下拉列表中选择Scala 2.11创建Scala 2.11笔记本 在Jupyter Notebook起始页的右上角.

and create Scala 2.11 notebooks by choosing Scala 2.11 in the dropdown in the upper right of the Jupyter Notebook start page.

注意:由于IPython现在已被Jupyter取代,因此我们在上述命令中将ipython替换为jupyter.

Note: Since IPython has now been replaced by Jupyter, we replaced ipython in the above commands with jupyter.

这篇关于如何在Jupyter IPython Notebook中安装Scala?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆