wsl安装python3.10

https://zhuanlan.zhihu.com/p/523708832

一、通过APT 方式获取

进入终端后输入以下

sudo apt update

接着,你需要安装PPA需要的软件源:

sudo apt install software-properties-common -y

然后,添加名为deadsnake的PPA源:(断网)

sudo add-apt-repository ppa:deadsnakes/ppa

这时候,就可以安装python3.10了:(加网)

sudo apt install python3.10

安装好后,通过以下命令验证:

python3.10 --version
Output
3.10.4

二、pip 无法安装 requirements

1、Run python3 -m venv env to create a directory called env for my virtual environment.
2、Then, within that directory, I run source bin/activate to activate the virtual environment
3、Ensure that the virtual environment is indeed running; (env) should appear at the start of the current line, and any subsequent lines.
4、进到项目目录安装 : pip install -r requirements.txt

!!第一步改为 python3.10 -m venv env10

发表新评论