栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

linux安装anaconda & 设置jupyter notebook 远程连接

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

linux安装anaconda & 设置jupyter notebook 远程连接

进入 https://repo.anaconda.com/archive/ 查看要安装的版本,如:

下载

wget https://repo.anaconda.com/archive/Anaconda3-2021.11-Linux-x86_64.sh

安装

bash Anaconda3-2021.11-Linux-x86_64.sh

安装位置

/root/anaconda3/bin/conda

sudo vi /etc/profile

添加
export PATH=/root/anaconda3/bin:$PATH

source /etc/profile

conda -V

conda create -n pt python==3.8

配置环境

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes

附:可以再安装一些常用的库
pip install numpy
pip install pandas
pip install scikit-learn
pip install matplotlib

安装jupyter

pip install jupyter

生成配置文件

jupyter notebook --generate-config

设置远程密码

(base) user@SYS:~$ ipython
Python 3.9.7 (default, Sep 16 2021, 13:09:58)
Type ‘copyright’, ‘credits’ or ‘license’ for more information
IPython 7.29.0 – An enhanced Interactive Python. Type ‘?’ for help.

In [1]: from notebook.auth import passwd
In [2]: passwd(algorithm=‘sha1’) ## 12345678 生成密码!!!: sha1:6943bfa21d18:1c50xxxxxxxxxx7b72bca80678ed8a66b49bfcc
Enter password:
Verify password:
Out[2]: ‘sha1:*****’

此处是密钥

In [3]: exit()

设置jupyter notebook

vim /home/user/.jupyter/jupyter_notebook_config.py

c.NotebookApp.ip = ‘*’
c.NotebookApp.password = u’前边的密钥’
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.allow_remote_access = True
c.NotebookApp.allow_root = True

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1005237.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号