我尝试使用此处提出的其他问题的建议。我运行了:
python3 -m venv tutorial_env
source tutorial_env/bin/activate -y
在终端。
执行之后终端显示如下:
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.11-venv
You may need to use sudo with that command.
After installing the python3-venv package, recreate your virtual environment.
Failing command: /home/user/tutorial_env/bin/python3
bash: tutorial_env/bin/activate: No such file or directory
然后使用该命令sudo apt install python3.11-venv -y
会导致waiting for cache lock held by Ubuntu-restricted-extras process
。
在“软件和更新”中,所有选项都已启用。
在运行以下命令之前,我也在终端中尝试过这个命令:sudo apt-get update && sudo apt-get install ubuntu-restricted-extras
我使用 验证了我的 python 版本是 Python 3.11.6 python3 --version
。