Ubuntu无法创建python venv环境

排查步骤如下

1. python3 -m venv venv

he 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.8-venvYou may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.Failing command: ['/mnt/d/myworkspace/workspace/bdd_demo/venv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

2. apt install python3.8-venv

E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

3. sudo apt install python3.8-venv

[sudo] password for admin: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:libsigsegv2 pastebinit python3-newt run-one
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:python3.8-venv
0 upgraded, 1 newly installed, 0 to remove and 167 not upgraded.
Need to get 5452 B of archives.
After this operation, 27.6 kB of additional disk space will be used.
Ign:1 http://mirrors.aliyun.com/ubuntu focal-security/universe amd64 python3.8-venv amd64 3.8.10-0ubuntu1~20.04.11
Err:1 http://mirrors.aliyun.com/ubuntu focal-security/universe amd64 python3.8-venv amd64 3.8.10-0ubuntu1~20.04.11404  Not Found [IP: 115.238.190.64 80]
E: Failed to fetch http://mirrors.aliyun.com/ubuntu/pool/universe/p/python3.8/python3.8-venv_3.8.10-0ubuntu1~20.04.11_amd64.deb  404  Not Found [IP: 115.238.190.64 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

4. sudo apt install python3.8-venv

sudo apt update

5. sudo apt update

Hit:1 http://mirrors.aliyun.com/ubuntu focal InRelease
Get:2 http://mirrors.aliyun.com/ubuntu focal-security InRelease [128 kB]
Get:3 http://mirrors.aliyun.com/ubuntu focal-updates InRelease [128 kB]
Get:4 http://mirrors.aliyun.com/ubuntu focal-proposed InRelease [277 kB]
Get:5 http://mirrors.aliyun.com/ubuntu focal-backports InRelease [128 kB]
Get:6 http://mirrors.aliyun.com/ubuntu focal-security/restricted Sources [55.3 kB]
Get:7 http://mirrors.aliyun.com/ubuntu focal-security/universe Sources [253 kB]
Get:8 http://mirrors.aliyun.com/ubuntu focal-security/multiverse Sources [17.1 kB]
Get:9 http://mirrors.aliyun.com/ubuntu focal-security/main Sources [331 kB]
Get:10 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 Packages [3357 kB]
Get:11 http://mirrors.aliyun.com/ubuntu focal-security/main Translation-en [490 kB]
Get:12 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 c-n-f Metadata [14.3 kB]
Get:13 http://mirrors.aliyun.com/ubuntu focal-security/restricted amd64 Packages [3343 kB]
Get:14 http://mirrors.aliyun.com/ubuntu focal-security/restricted Translation-en [468 kB]
Get:15 http://mirrors.aliyun.com/ubuntu focal-security/restricted amd64 c-n-f Metadata [548 B]
Get:16 http://mirrors.aliyun.com/ubuntu focal-security/universe amd64 Packages [1031 kB]
Get:17 http://mirrors.aliyun.com/ubuntu focal-security/universe Translation-en [218 kB]
Get:18 http://mirrors.aliyun.com/ubuntu focal-security/universe amd64 c-n-f Metadata [21.4 kB]
Get:19 http://mirrors.aliyun.com/ubuntu focal-security/multiverse amd64 Packages [24.8 kB]
Get:20 http://mirrors.aliyun.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [540 B]
Get:21 http://mirrors.aliyun.com/ubuntu focal-updates/main Sources [606 kB]
Get:22 http://mirrors.aliyun.com/ubuntu focal-updates/restricted Sources [56.5 kB]
Get:23 http://mirrors.aliyun.com/ubuntu focal-updates/universe Sources [411 kB]
Get:24 http://mirrors.aliyun.com/ubuntu focal-updates/multiverse Sources [30.0 kB]
Get:25 http://mirrors.aliyun.com/ubuntu focal-updates/main amd64 Packages [3735 kB]
Get:26 http://mirrors.aliyun.com/ubuntu focal-updates/main Translation-en [570 kB]
Get:27 http://mirrors.aliyun.com/ubuntu focal-updates/main amd64 c-n-f Metadata [17.8 kB]
Get:28 http://mirrors.aliyun.com/ubuntu focal-updates/restricted amd64 Packages [3493 kB]
Get:29 http://mirrors.aliyun.com/ubuntu focal-updates/restricted Translation-en [488 kB]
Get:30 http://mirrors.aliyun.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [548 B]
Get:31 http://mirrors.aliyun.com/ubuntu focal-updates/universe amd64 Packages [1253 kB]
Get:32 http://mirrors.aliyun.com/ubuntu focal-updates/universe Translation-en [300 kB]
Get:33 http://mirrors.aliyun.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [28.3 kB]
Get:34 http://mirrors.aliyun.com/ubuntu focal-updates/multiverse amd64 Packages [27.9 kB]
Get:35 http://mirrors.aliyun.com/ubuntu focal-updates/multiverse Translation-en [7968 B]
Get:36 http://mirrors.aliyun.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [612 B]
Get:37 http://mirrors.aliyun.com/ubuntu focal-proposed/restricted Sources [4932 B]
Get:38 http://mirrors.aliyun.com/ubuntu focal-proposed/multiverse Sources [1948 B]
Get:39 http://mirrors.aliyun.com/ubuntu focal-proposed/universe Sources [9904 B]
Get:40 http://mirrors.aliyun.com/ubuntu focal-proposed/main Sources [30.7 kB]
Get:41 http://mirrors.aliyun.com/ubuntu focal-proposed/main amd64 Packages [254 kB]
Get:42 http://mirrors.aliyun.com/ubuntu focal-proposed/main Translation-en [52.3 kB]
Get:43 http://mirrors.aliyun.com/ubuntu focal-proposed/main amd64 c-n-f Metadata [1436 B]
Get:44 http://mirrors.aliyun.com/ubuntu focal-proposed/restricted amd64 Packages [358 kB]
Get:45 http://mirrors.aliyun.com/ubuntu focal-proposed/restricted Translation-en [51.5 kB]
Get:46 http://mirrors.aliyun.com/ubuntu focal-proposed/restricted amd64 c-n-f Metadata [116 B]
Get:47 http://mirrors.aliyun.com/ubuntu focal-proposed/universe amd64 Packages [38.0 kB]
Get:48 http://mirrors.aliyun.com/ubuntu focal-proposed/universe Translation-en [19.4 kB]
Get:49 http://mirrors.aliyun.com/ubuntu focal-proposed/universe amd64 c-n-f Metadata [1772 B]
Get:50 http://mirrors.aliyun.com/ubuntu focal-proposed/multiverse amd64 Packages [7460 B]
Get:51 http://mirrors.aliyun.com/ubuntu focal-proposed/multiverse Translation-en [2348 B]
Get:52 http://mirrors.aliyun.com/ubuntu focal-proposed/multiverse amd64 c-n-f Metadata [312 B]
Fetched 22.1 MB in 5s (4912 kB/s)        
Reading package lists... Done
Building dependency tree       
Reading state information... Done
192 packages can be upgraded. Run 'apt list --upgradable' to see them.

6. sudo apt install python3.8-venv

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:libsigsegv2 pastebinit python3-newt run-one
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:libpython3.8 libpython3.8-dev libpython3.8-minimal libpython3.8-stdlib python3.8 python3.8-dev python3.8-minimal
Suggested packages:python3.8-doc binfmt-support
The following NEW packages will be installed:python3.8-venv
The following packages will be upgraded:libpython3.8 libpython3.8-dev libpython3.8-minimal libpython3.8-stdlib python3.8 python3.8-dev python3.8-minimal
7 upgraded, 1 newly installed, 0 to remove and 185 not upgraded.
Need to get 10.8 MB of archives.
After this operation, 44.0 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 python3.8-dev amd64 3.8.10-0ubuntu1~20.04.13 [514 kB]
Get:2 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 libpython3.8-dev amd64 3.8.10-0ubuntu1~20.04.13 [3950 kB]
Get:3 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 libpython3.8 amd64 3.8.10-0ubuntu1~20.04.13 [1625 kB]
Get:4 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 python3.8 amd64 3.8.10-0ubuntu1~20.04.13 [387 kB]
Get:5 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 libpython3.8-stdlib amd64 3.8.10-0ubuntu1~20.04.13 [1675 kB]
Get:6 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 python3.8-minimal amd64 3.8.10-0ubuntu1~20.04.13 [1900 kB]
Get:7 http://mirrors.aliyun.com/ubuntu focal-security/main amd64 libpython3.8-minimal amd64 3.8.10-0ubuntu1~20.04.13 [720 kB]
Get:8 http://mirrors.aliyun.com/ubuntu focal-security/universe amd64 python3.8-venv amd64 3.8.10-0ubuntu1~20.04.13 [5452 B]
Fetched 10.8 MB in 1s (7955 kB/s)
(Reading database ... 45428 files and directories currently installed.)
Preparing to unpack .../0-python3.8-dev_3.8.10-0ubuntu1~20.04.13_amd64.deb ...
Unpacking python3.8-dev (3.8.10-0ubuntu1~20.04.13) over (3.8.10-0ubuntu1~20.04.11) ...
Preparing to unpack .../1-libpython3.8-dev_3.8.10-0ubuntu1~20.04.13_amd64.deb ...
Unpacking libpython3.8-dev:amd64 (3.8.10-0ubuntu1~20.04.13) over (3.8.10-0ubuntu1~20.04.11) ...
Preparing to unpack .../2-libpython3.8_3.8.10-0ubuntu1~20.04.13_amd64.deb ...
Unpacking libpython3.8:amd64 (3.8.10-0ubuntu1~20.04.13) over (3.8.10-0ubuntu1~20.04.11) ...
Preparing to unpack .../3-python3.8_3.8.10-0ubuntu1~20.04.13_amd64.deb ...
Unpacking python3.8 (3.8.10-0ubuntu1~20.04.13) over (3.8.10-0ubuntu1~20.04.11) ...
Preparing to unpack .../4-libpython3.8-stdlib_3.8.10-0ubuntu1~20.04.13_amd64.deb ...
Unpacking libpython3.8-stdlib:amd64 (3.8.10-0ubuntu1~20.04.13) over (3.8.10-0ubuntu1~20.04.11) ...
Preparing to unpack .../5-python3.8-minimal_3.8.10-0ubuntu1~20.04.13_amd64.deb ...
Unpacking python3.8-minimal (3.8.10-0ubuntu1~20.04.13) over (3.8.10-0ubuntu1~20.04.11) ...
Preparing to unpack .../6-libpython3.8-minimal_3.8.10-0ubuntu1~20.04.13_amd64.deb ...
Unpacking libpython3.8-minimal:amd64 (3.8.10-0ubuntu1~20.04.13) over (3.8.10-0ubuntu1~20.04.11) ...
Selecting previously unselected package python3.8-venv.
Preparing to unpack .../7-python3.8-venv_3.8.10-0ubuntu1~20.04.13_amd64.deb ...
Unpacking python3.8-venv (3.8.10-0ubuntu1~20.04.13) ...
Setting up libpython3.8-minimal:amd64 (3.8.10-0ubuntu1~20.04.13) ...
Setting up python3.8-minimal (3.8.10-0ubuntu1~20.04.13) ...
Setting up libpython3.8-stdlib:amd64 (3.8.10-0ubuntu1~20.04.13) ...
Setting up python3.8 (3.8.10-0ubuntu1~20.04.13) ...
Setting up libpython3.8:amd64 (3.8.10-0ubuntu1~20.04.13) ...
Setting up python3.8-venv (3.8.10-0ubuntu1~20.04.13) ...
Setting up libpython3.8-dev:amd64 (3.8.10-0ubuntu1~20.04.13) ...
Setting up python3.8-dev (3.8.10-0ubuntu1~20.04.13) ...
Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for mime-support (3.64ubuntu1) ...

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/65291.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

如何很快将文件转换成另外一种编码格式?编码?按指定编码格式编译?如何检测文件编码格式?Java .class文件编码和JVM运行期内存编码?

如何很快将文件转换成另外一种编码格式? 利用VS Code右下角的"选择编码"功能,选择"通过编码保存"可以很方便将文件转换成另外一种编码格式。尤其,在测试w/ BOM或w/o BOM, 或者ANSI编码和UTF编码转换,特别方便。VS文件另…

PCL点云库入门——PCL库点云特征之PFH点特征直方图(Point Feature Histograms -PHF)

1、算法原理 PFH点(Point Feature Histogram)特征直方图的原理涉及利用参数化查询点与邻域点之间的空间差异,并构建一个多维直方图以捕捉点的k邻域几何属性。这个高维超空间为特征表示提供了一个可度量的信息空间,对于点云对应曲面…

5. CSS引入方式

5.1 CSS的三种样式 按照 CSS 样式书写的位置(或者引入的方式),CSS样式表可以分为三大类: 1.行内样式表(行内式) 2.内部样式表(嵌入式) 3. 外部样式表(链接式) 5.2 内部样式表 …

为什么ip属地一会河南一会江苏

在使用互联网的过程中,许多用户可能会遇到这样一个问题:自己的IP属地一会儿显示为河南,一会儿又变成了江苏。这种现象可能会让人感到困惑,甚至产生疑虑,担心自己的网络活动是否受到了某种影响。为了解答这一疑问&#…

unity3d-搞个场景漫游如何实现Alpha

要处理两个问题: 如何设置地面人不掉下去 方法一、 游戏物体加刚体,将游戏物体和地面加collider。如果是地形,可以使用 Terrain Collider;如果是简单的平面,可以添加 Box Collider 或者 Mesh Collider(如果…

git merge rebase

merge操作 Git自己分支合并dev分支 rebase 操作 git rebase

doris 2.1 temporay partition 测试及总结

测试步骤 创建表 drop table order_info_shuffle; CREATE TABLE order_info_shuffle ( order_id varchar(20), user_id varchar(20), goods_id

jmeter性能测试例子

目录 一、介绍 二、操作例子 设置线程数 添加同步定时器 添加聚合报告 一、介绍 在软件测试中,一般用jmeter来对接口做性能测试,对对接口进行一个压力的测试。 简述: 在接口的线程中设置线程的数量和时间,添加一个定时器…

C# 设计模式(行为型模式):解释器模式

C# 设计模式(行为型模式):解释器模式 (Interpreter Pattern) 什么是解释器模式? 解释器模式(Interpreter Pattern)是一种行为型设计模式,用于定义一种语言的语法表示,并提供一个解释…

ubuntu16 重启之后lvm信息丢失故障恢复

一、背景 1、问题背景 业务有一台物理开发服务器,文件系统有损坏;由于重启时没有检查,导致重启卡住。后面通过断电重新启动之后,无法进入系统;进入救援模式,注释数据盘挂载。重启之后进入系统&#xff0c…

React函数组件中与生命周期相关Hooks详解

React 函数组件及其钩子渲染流程是 React 框架中的核心概念之一。以下是对该流程的详细解析: 一、React 函数组件基础 定义: React 函数组件是一个接收 props 作为参数并返回 React 元素的函数。它们通常用于表示 UI 的一部分,并且不保留内部…

水一篇水水水

为了拿推广卷,但不想把我原本完整的文章拆成零散的多篇,只能出此下策随便发一篇,认真写的都笔记专栏里 网络是由若干节点和连接这些节点的链路构成,表示诸多对象及其相互联系。 在1999年之前,人们一般认为网络的结构都…

PDFelement 特别版

Wondershare PDFelement Pro 是一款非常强大的PDF编辑软件,它允许用户轻松地编辑、转换、创建和管理PDF文件。这个中文特别版的软件具有许多令人印象深刻的功能,PDFelement Pro 提供了丰富的编辑功能,可以帮助用户直接在PDF文件中添加、删除、…

C语言的正则表达式

C语言中的正则表达式 引言 正则表达式是一种用于描述字符串模式的工具,它可以用来进行字符串匹配、查找、替换等操作。在编程中,正则表达式被广泛应用于数据验证、信息提取等场景。C语言虽然没有内置的正则表达式支持,但通过一些库我们同样…

【OpenCV】使用Python和OpenCV实现火焰检测

1、 项目源码和结构(转) https://github.com/mushfiq1998/fire-detection-python-opencv 2、 运行环境 # 安装playsound:用于播放报警声音 pip install playsound # 安装opencv-python:cv2用于图像和视频处理,特别是…

GO随想:GO的并发等待

协程并发等待技术——WaitGroup 类型和 errgroup 包 waitgroup 阻塞等待多个并发任务执行完成。WaitGroup 类型主要包含下面几个方法。 func (wg *WaitGroup) Add(delta int) func (wg *WaitGroup) Done() func (wg *WaitGroup) Wait() 第一个是 Add 方法,在任务运…

深入理解Mybatis原理》MyBatis的sqlSessi

sqlSessionFactory 与 SqlSession 正如其名,Sqlsession对应着一次数据库会话。由于数据库会话不是永久的,因此Sqlsession的生命周期也不应该是永久的,相反,在你每次访问数据库时都需要创建它(当然并不是说在Sqlsession…

《HarmonyOS第一课》焕新升级,赋能开发者快速掌握鸿蒙应用开发

随着HarmonyOS NEXT发布,鸿蒙生态日益壮大,广大开发者对于系统化学习平台和课程的需求愈发强烈。近日,华为精心打造的《HarmonyOS第一课》全新上线,集“学、练、考”于一体,凭借多维融合的教学模式与系统课程设置&…

springboot集成整合工作流,activiti审批流,整合实际案例,流程图设计,流程自定义,表单配置自定义,代码demo流程

前言 activiti工作流引擎项目,企业erp、oa、hr、crm等企事业办公系统轻松落地,一套完整并且实际运用在多套项目中的案例,满足日常业务流程审批需求。 一、项目形式 springbootvueactiviti集成了activiti在线编辑器,流行的前后端…

《探秘计算机视觉与深度学习:开启智能视觉新时代》

《探秘计算机视觉与深度学习:开启智能视觉新时代》 一、追溯起源:从萌芽到崭露头角二、核心技术:解锁智能视觉的密码(一)卷积神经网络(CNN):图像识别的利器(二&#xff0…