簡體   English   中英

Pop OS 升級到 21.04 后,python3.8-venv 不再工作

[英]python3.8-venv is no longer working after Pop OS upgraded to 21.04

升級到 Pop OS 21.04 后,我無法為 python 3.8 創建任何虛擬環境。 收到以下錯誤 -

sudo apt-get install python3.8-venv
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python3.8-venv is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3.8-venv' has no installation candidate

我已經嘗試添加 deadsnakes 存儲庫( 博客文章)。 不幸的是,它沒有幫助。 另外,我發現了以下信息-

apt show python3.8
Package: python3.8
Version: 3.8.10-0ubuntu1~20.10.1
Status: install ok installed
Priority: important
Section: python
Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Matthias Klose <doko@debian.org>
Installed-Size: 521 kB
Depends: python3.8-minimal (= 3.8.10-0ubuntu1~20.10.1), libpython3.8-stdlib (= 3.8.10-0ubuntu1~20.10.1), mime-support
Suggests: python3.8-venv, python3.8-doc, binutils
Breaks: python3-all (<< 3.6.5~rc1-1), python3-dev (<< 3.6.5~rc1-1), python3-venv (<< 3.6.5-2)
Download-Size: unknown
APT-Manual-Installed: yes
APT-Sources: /var/lib/dpkg/status
Description: Interactive high-level object-oriented language (version 3.8)
 Python is a high-level, interactive, object-oriented language. Its 3.8 version
 includes an extensive class library with lots of goodies for
 network programming, system administration, sounds and graphics.

Apt-Sources項目對我來說似乎有點奇怪。 更新后的系統中默認的 python 版本是 3.9.5。

知道如何解決這個問題嗎?

venv是 Python 3.6標准庫的一部分 您不需要安裝它。 只需致電:

python3.8 -m venv /path/to/new/virtual/environment

PyCharm 2021.1.3 社區版
流行!_OS 21.04
蟒蛇 3.9.5

有完全相同的問題。 這對我有用:創建新項目並制作新 venv 時,選擇 python3.9 作為基本解釋器(3.8 是我的默認選擇)。

我可以通過在創建新項目時選擇 python3.8 來重新創建此錯誤。

收到錯誤后,我進入目錄並刪除了venv目錄的內容。 在 PyCharm 中,我轉到 Settings --> Project: [project_name] --> Python Interpreter 並使用 python3.9 創建了一個新的 venv,沒有錯誤,包安裝。

隨后,我創建了新項目,確保選擇了 python3.9 而不是 python3.8 並且我沒有收到錯誤,附加包安裝沒有問題。

適用於流行操作系統 21.04

默認 python 版本是 3.9.5

它需要在下面進行安裝

sudo apt install python3.9-venv -y

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM