在Linux下面创建python虚拟环境 - 详解
首先我们运行这个代码
python3 -m venv progress
如果弹出这个这个页面
The virtual environment was not created successfully because ensurepip is not
available. On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.
apt install python3.12-venv
You may need to use sudo with that command. After installing the python3-venv
package, recreate your virtual environment.
Failing command: /home/li/桌面/python/progress/bin/python3
意思就是你没有这个包 python 3.12-venv的包
输入下面命令
python版本看自己的版本使用
python -v 查看python版本
sudo apt install python3.12-venv
之后在运行上面的
python3 -m venv progress
就可以实现了