美文网首页
Python、R、Jupyter、GitHub安装

Python、R、Jupyter、GitHub安装

作者: MARIOLEEKY | 来源:发表于2018-11-20 15:51 被阅读0次

1、python安装

    https://www.python.org/

        安装时注意勾选Add python xx to path (将python加入到系统环境变量)


2、Jupyter Notebook 和 pip

        运行cmd,切换到python安装目录,运行pip install

C:\Users\Administrator>cd /d D:\

D:\>cd D:\SoftWare\Python\Python36\Scripts  

D:\SoftWare\Python\Python36\Scripts>pip install jupyter


3、 jupyter notebook的启动

            命令行窗口输入:jupyter notebook

同时,默认浏览器会打开 Jupyter notebook 窗口。 说明 Jupyter notebook 安装成功了。



4、配置 Jupyter notebook

jupyter notebook --generate-config

D:\SoftWare\Python\Python36\Scripts>jupyter notebook --generate-config

修改jupyter_notebook_config.py配置文件

打开这个配置文件,找到“c.NotebookApp.notebook_dir=……”,把路径改成自己的工作目录。

 比如,这里要变更为

## The directory to use for notebooks and kernels.

c.NotebookApp.notebook_dir = 'D:\Code\jupyter-notebook'

,当然,文件夹 jupyter-notebook 需要自己创建好

配置文件修改完成后, 以后在 jupyter notebook 中写的代码等都会保存在自己创建的目录中。 

 jupyter notebook的自定义启动(变了)

配置文件修改成后,就可以启动 jupyter notebook 了,命令行窗口中输入 jupyter notebook,

默认浏览器就会打开一个页面 

 jupyter notebook的启动

命令行窗口输入:jupyter notebook

  以前是

现在是

5、R的安装

        https://www.r-project.org/index.html

6、GitHub安装

        https://blog.csdn.net/qazwsxpcm/article/details/68946736

7、配置R,使Jupyter Notebook支持R

    在R命令行下,运行

install.packages(c('repr', 'IRdisplay', 'evaluate', 'crayon', 'pbdZMQ', 'devtools', 'uuid', 'digest'))

devtools::install_github('IRkernel/IRkernel')

上面的代码会自动分两步执行,执行完后,在输入如下代码中的一个:

# 只在当前用户下安装

IRkernel::installspec()

# 或者是在系统下安装

IRkernel::installspec(user = FALSE)

等待执行完毕,打开jupyter就可以新建R的notebook了。

恩~ 就是这么简单,接下来就可以愉快的写R了

---------------------

https://blog.csdn.net/qazwsxpcm/article/details/68946736

相关文章

网友评论

      本文标题:Python、R、Jupyter、GitHub安装

      本文链接:https://www.haomeiwen.com/subject/enbtqqtx.html