在服务器安装自己的环境
安装包路径:
官网 https://www.anaconda.com/distribution/#download-section
BT https://bt.byr.cn/details.php?id=287028&hit=1
1 安装conda
- sh Anaconda*sh(版本根据自己下载的anaconda进行更改)
sh Anaconda3-2019.03-Linux-x86_64.sh
2 安装自己的隔离环境
- cd /Anaconda/bin
- conda create -n 新建虚拟环境的名字 python=对应的版本号
e.g. conda create -n qEnv python=3.7.3 - 激活
conda activate qEnv - 退出
source deactivate qEnv - 克隆
conda create --name [虚拟环境名] -- clone [colne的环境]
3 配置jupyter
- 安装
conda install jupyter - 初始化配置文件
jupyter notebook --generate-config - 进入python 环境
python3
from notebook.auth import passwd
passwd()
Enter password:
Verify password:
'sha1:46c737b70514:779ceca92548be77f45389ac8bc5b3d67cbded43' - 修改配置环境
vi .jupyter/jupyter_notebook_config.py
c.NotebookApp.allow_root = True (设置root权限可登陆)
c.NotebookApp.ip='' 设置远程登录ip,为任意ip皆可。
c.NotebookApp.notebook_dir = '/home/qy/project' 设置启动路径(即文件存储路径)
c.NotebookApp.password =
'sha1:46c737b70514:779ceca92548be77f45389ac8bc5b3d67cbded43' (秘钥)
c.NotebookApp.open_browser = False (设置服务器浏览器不自动打开)
c.NotebookApp.port =2200 (设置端口)
4 安装pytorch
conda install pytorch
!pip install jieba
!pip install gensim
!pip install torchtext
!pip install visdom
! pip install pandas
conda install nb_conda # 切换kernel 环境
ps:如果失效说明你可能还没有重启环境
代码自动补全和字体主题
参考https://www.cnblogs.com/qiuxirufeng/p/9609031.html
https://www.jianshu.com/p/c1450a6647ec
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
pip install jupyter_nbextensions_configurator