赞
踩
请浏览“安装多版本python 建立虚拟环境”,建立虚拟python环境。
假设原python路径为"D:\Program Files\Python310",虚拟环境将建立在d:\mpy\python3108。
打开“Windows PowerShell”程序,输入以下命令。
- & "D:\Program Files\Python310\python" -m venv d:\mypy\python3108
-
进入虚拟Python主环境
- d:\mypy\python3108\scripts\Activate.ps1
- python --version
- pip list
-
请浏览“离线安装Python第三方库及依赖库”,离线下载升级安装包。
国内网速缓慢的,download时可以添加“-i https://pypi.tuna.tsinghua.edu.cn/simple”参数。
1.基本包
- pip3 download pip setuptools -d d:\software\pip
- python -m pip install --no-index --find-links=d:\software\pip --upgrade pip setuptools
-
2.Jupyterlab包
- pip3 download jupyterlab -d d:\software\jupyterlab
- pip3 install --no-index --find-links=d:\software\jupyterlab jupyterlab
-
1.设定密码
- jupyter lab password
-
2.配置参数
C:\Users\登录名\.jupyter\jupyter_server_config.json
“password”行数据保持不变,添加其他行数据。
{
"ServerApp": {
"password": "argon2:$argon2id$v=19$m=10240,t=10,p=8$rQAH6yOcwklwv8NwFCmA" ,
"port" : 8080
}
}
- pip3 download jupyterlab-language-pack-zh-CN -d d:\software\jupyter_extension
- pip3 install --no-index --find-links=d:\software\jupyter_extension jupyterlab-language-pack-zh-CN
-
- jupyter lab
-
1.设定虚拟环境
- #激活虚拟环境
- & "D:\Program Files\Python39\python" -m venv d:\mypy\python3913
- d:\mypy\python3913\scripts\Activate.ps1
- python --version
- pip list
-
- #安装升级包
- pip3 download pip setuptools -d d:\software\pip
- python -m pip install --no-index --find-links=d:\software\pip --upgrade pip setuptools
-
- #安装ipykernel
- pip3 download ipykernel -d d:\software\ipykernel -i https://pypi.tuna.tsinghua.edu.cn/simple
- pip3 install --no-index --find-links=d:\software\ipykernel ipykernel
-
2.安装Jupyterlab的多内核环境
python -m ipykernel install --user --name python3913 --display-name "Python-3.9.13"
C:\Users\登录名\AppData\Roaming\jupyter\kernels\python3913 为安装的 kernelspec。
3.检查多内核设置
- #进入主虚拟环境
- d:\mypy\python3108\scripts\Activate.ps1
-
- #查验版本信息
- python --version
- pip list
- jupyter kernelspec list
-
-
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。