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

Viewed 1755

I'm not able to create any virtual environments for python 3.8 after upgrading to Pop OS 21.04. Getting the following error -

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

I have already tried adding deadsnakes repo (blog post). Unfortunately, it isn't helping. Also, I found the following info -

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.

The Apt-Sources item seems a bit strange to me. The default python version is 3.9.5 in the updated system.

Any idea how this can be resolved ?

3 Answers

venv is part of the standard library as of Python 3.6. You do not need to install it. Just call:

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

PyCharm 2021.1.3 Community Edition
Pop!_OS 21.04
Python 3.9.5

Had exact same issue. This worked for me: When creating a new project and making a new venv, select python3.9 as the base interpreter (3.8 was the default selection for me).

I can recreate this error by selecting python3.8 when creating a new project.

After receiving the error, I went into directory and deleted the contents of the venv directory. In PyCharm I went to Settings --> Project: [project_name] --> Python Interpreter and created a new venv with python3.9 and no errors, packages install.

Subsequently, I created new projects making sure that python3.9 is selected instead of python3.8 and I do not get errors, additional packages install without issue.

for pop os 21.04

default python version is 3.9.5

it need make install below

sudo apt install python3.9-venv -y
Related