Anaconda简介
Anaconda 是一个用于科学计算的 Python 发行版,支持 Linux, Mac, Windows, 包含了众多流行的科学计算、数据分析的 Python 包。
Anaconda 安装包可以到 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 下载。
安装
-
下载Anaconda3-2020.07-Linux-x86_64.sh包
$ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-2020.07-Linux-x86_64.sh
-
执行安装包安装,根据提示完成安装
$ bash Anaconda3-2020.07-Linux-x86_64.sh
-
关闭当前shell连接,重新连接liunx,执行命令测试
$ python3
启动Jupyter Notebook远程访问
-
生成配置文件
$ jupyter notebook --generate-config
-
准备Hash密码
# 进入ipython环境 $ ipython Python 3.8.3 (default, Jul 2 2020, 16:21:59) Type 'copyright', 'credits' or 'license' for more information IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help. In [1]: from notebook.auth import passwd In [2]: passwd() Enter password: Verify password: Out[2]: 'sha1:a9eaaf890825:5c50b341fc3f516b8d622d180ce06db8f40882dc'
-
修改配置文件
$ vi /home/hadoop/.jupyter/jupyter_notebook_config.py # 配置内容 # Set ip to '*' to bind on all interfaces (ips) for the public server c.NotebookApp.ip = '*' c.NotebookApp.password = u'sha1:a9eaaf890825:5c50b341fc3f516b8d622d180ce06db8f40882dc' c.NotebookApp.open_browser = False c.NotebookApp.allow_remote_access = True # 共享目录 c.NotebookApp.notebook_dir = '/home/hadoop/share' # It is a good idea to set a known, fixed port for server access c.NotebookApp.port = 8899
-
启动Jupyter Notebook
$ jupyter notebook
-
访问http://ip:8899