随着生物信息学技术和AI技术的发展,python以更快的运行速度和更少的内存占用率越来越受到欢迎。
卡卡与时俱进,更新R语言时会同步更新python的内容!
python的教程基本说是从0开始的,所以适合任何想从python入手生物信息学的小白!
今天卡卡带着大家从服务器上配置jupyterlab开始。
conda想必大家都非常熟悉,前期可以自己安装配置一下,卡卡带着大家从配置镜像源开始:(亲测下载速度很快)
进入condarc文件
vim ~/.condarc
输入以下命令
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
conda create -n jupyterlab
conda activate jupyterlab
conda install numpy matplotlib pandas jupyterlab
生成配置文件
jupyter lab --generate-config
修改配置文件:
vim /home/sxyd/.jupyter/jupyter_lab_config.py
c.NotebookApp.ip = '0.0.0.0'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8899
c.MappingKernelManager.root_dir = '/home/sxyd' #需保证此目录存在
c.NotebookApp.allow_remote_access = True
新建一个systemd服务文件
sudo nano /etc/systemd/system/jupyterlab.service
编辑输入以下内容:
[Unit]
Description=JupyterLab Service
[Service]
Type=simple
PIDFile=/run/jupyter.pid
ExecStart=/home/sxyd/miniconda3/envs/jupyterlab/bin/jupyter lab --config=/home/sxyd/.jupyter/jupyter_lab_config.py
User=sxyd
Group=sxyd
WorkingDirectory=/home/sxyd/
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
启动jupyterlab服务
# Reload systemd manager configuration
sudo systemctl daemon-reload
# Start the JupyterLab service immediately
sudo systemctl start jupyterlab
# Enable the service to start automatically at boot
sudo systemctl enable jupyterlab
# Check the service status (optional)
systemctl status jupyterlab
有时候可能会要求输入token,根据实际输出的内容,将token输入进行即可
pip install jupyterlab-language-pack-zh-CN
环境配置的内容到此就结束啦!接下来就可以愉快的学习和使用python了
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。