【langchain chatchat 0.3.x从头部署详细过程(一)win11使用wsl部署linux子系统(ubuntu)】

win11使用wsl部署linux子系统(ubuntu)

1.打开Windows的三个虚拟化功能

在这里插入图片描述
在这里插入图片描述
注:Windows 11 家庭版需安装 Hyper-V
复制以下批处理代码,新建空白文本后保存,保存更改文本 .txt 后缀为 .bat 格式。右键以管理员身份运行即可。

pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
pause

在这里插入图片描述

重启电脑之后勾选即可。

2.安装linux子系统

下载wsl

下载地址:https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi

在Microsoft Store下载Ubuntu

在这里插入图片描述
在应用商店点击获取之后,会自动下载,完成后点击“安装”,弹出一个DOS窗口按任意键安装。根据提示完成安装(期间会让你设置用户名和密码),完成后下次登录只需要在PowerShell或CMD窗口输入“WSL”即可打开Ubuntu系统

3.wsl迁移到其他盘

wsl默认下到c盘,后续可能占据内存会比较多,如果c盘不够大,可以移动到其他数据盘
参考这个博客
https://blog.csdn.net/weixin_42705114/article/details/131106845

4.安装Anaconda

下载annaconda
https://www.anaconda.com/download/success
在这里插入图片描述
将下载的文件拷入到指定目录/mnt(自己指定)

在这里插入图片描述
cd到当前目录

cd /mnt
bash Anaconda3-2023.09-0-Linux-x86_64.sh

按PageDOWN快速跳过协议,输入yes安装

加入环境变量

echo 'export PATH="/home/cyber(这里改成你自己的用户名)/anaconda3/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

安装完成以后,可以查看版本号
查看conda版本:conda -V
查看python版本: python -V

5.创建虚拟环境

# 创建虚拟环境
conda create -n 虚拟环境名称 python=3.10

#查看环境
conda info -e

#激活环境
conda activate 虚拟环境名称

#退出环境
deactivate

6.安装pip

sudo apt update
apt install python3-pip

7.更换镜像源

mkdir ~/.pip
vi ~/.pip/pip.conf

将以下粘贴进去,:wq 保存退出

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值