程序安装教程
目录
警告
本文最后更新于 2024-01-19,文中内容可能已过时。
一、 apt-get source update
- apt-get source
change the
/etc/apt/sources.listfile to aliyun source - add sudo user in rootlink
1adduser [name]赋予用户1apt-get install sudosudo权限:在文件1 2 3sudo usermod -a -G adm username sudo usermod -a -G sudo username su [name]/etc/sudoers中更改用户的sudo权限:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20# sudoers file. # # This file MUST be edited with the 'vi sudo' command as root. # # See the sudoers man page for the details on how to write a sudoers file. # # Host alias specification # User alias specification # Cmnd alias specification # Defaults specification # User privilege specification root ALL=(ALL) ALL [username] ALL=(ALL) ALL # Uncomment to allow people in group wheel to run all commands # %wheel ALL=(ALL) ALL # Same thing without a password # %wheel ALL=(ALL) NOPASSWD: ALL # Samples # %users ALL=/sbin/mount /cdrom,/sbin/umount /cdrom # %users localhost=/sbin/shutdown -h now
二、 Anaconda or Miniconda Installation
download anaconda or miniconda from tsinghua source website
download command:
1wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.shrun the command to install:
1bash Miniconda3-latest-linux-x86_64.shchange the conda channels to tsinghua source
1nano ~/.condarcpaste the following channels into your
~/.condarcfile:ref link1 2 3 4 5 6 7 8 9 10 11 12 13 14 15conda 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 Forge conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/ #msys2(可略) conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ #bioconda(可略) conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/ #menpo(可略) conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/ #pytorch conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ # for legacy win-64(可略) conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/peterjc123/ conda config --set show_channel_urls yesanaconda 环境文件
environment.yml使用参考 创建环境:1conda env create -f environment.yml -n myenv导出当前环境配置:
1conda env export > environment.yml更新环境:
1conda env update -f environment.yml
三、 Cmake Installation
- Download cmake source file:
1wget https://cmake.org/files/v3.20/cmake-3.20.0-linux-x86_64.tar.gz - extract the file and move the file to
/opt/cmake-3.20.01 2tar zxvf cmake-3.20.0-linux-x86_64.tar.gz mv cmake-3.20.0-linux-x86_64 /opt/cmake-3.20.0 - link the cmake as system cmake
1ln -sf /opt/cmake-3.20.0/bin/* /usr/bin/ - check if successfully installed
1cmake --version
四、 Openmpi Installation
- Install
openmpiwith command line:1sudo apt-get install openmpi-bin openmpi-doc libopenmpi-dev - 在conda下安装openmapi:
1conda install openmpi
五、 Anaconda下安装jupyter notebook
安装jupyter notebook
1pip install jupyter notebook==6.1.0安装nbextensions
1 2pip install jupyter_contrib_nbextensions jupyter contrib nbextension install --user如果遇到如下报错信息:
1ModuleNotFoundError: No module named 'notebook.base'注意: 一般由于notebook版本>=7.0.0导致 原因: Notebook的版本太高了,将notebook的版本降到
6.1.01 2pip install jupyter notebook==6.1.0 # 或者 pip install --upgrade notebook==6.1.0然后再重新安装插件。
安装nbextensions_configurator
1 2pip install jupyter_nbextensions_configurator jupyter nbextensions_configurator enable --user启动jupyter Notebook
1jupyter notebook若如下报错:
1 2ModuleNotFoundError: No module named 'jupyter_server.contents' TypeError: warn() missing 1 required keyword-only argument: 'stacklevel'则执行以下命令安装
traitlets库:1pip install traitlets==5.9.0在
codemirror.css文件中更改字体 文件路径:/home/{$USERNAME}/miniconda3/envs/pytorch/lib/python3.8/site-packages/notebook/static/components/codemirror/lib/codemirror.css推荐安装的几个jupyter插件:
- zenmode
- table of content(2)
- Autopep8
- variable inspector
- ExecuteTime
- Hide input all 隐藏代码输入
jupyter notebook v7.0 extension installation support: https://github.com/jupyter/notebook/discussions/6881
Buy me a coffee~
支付宝
微信