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.pswp.cn/web/65291.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/65291.shtml
英文地址,請注明出處:http://en.pswp.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…