Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 7072

How to install python3.10 virtual environment when python3.10-venv has no installation candidate? [closed]

$
0
0

I had just upgraded to Ubuntu 22.04.1 LTS, which comes preinstalled with python3.10. I tried creating a virtual environment but it was unsuccessful. Trying to install the virtual env package gets an error E: Package 'python3-venv' has no installation candidate

python3 -m venv newpy310The virtual environment was not created successfully because ensurepip is notavailable.  On Debian/Ubuntu systems, you need to install the python3-venvpackage using the following command.    apt install python3.10-venvYou may need to use sudo with that command.  After installing the python3-venvpackage, recreate your virtual environment.Failing command: ['/home/user/Desktop/pyenvs/newpy310/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

Following which i used sudo apt install python3.10-venv, and was returned with

sudo apt install python3.10-venvReading package lists... DoneBuilding dependency tree... DoneReading state information... DonePackage python3.10-venv is not available, but is referred to by another package.This may mean that the package is missing, has been obsoleted, oris only available from another sourceE: Package 'python3.10-venv' has no installation candidate

Something similar can be encountered if I used sudo apt install python3.10-virtualenv

sudo apt-get install python3.10-virtualenvReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneE: Unable to locate package python3.10-virtualenvE: Couldn't find any package by glob 'python3.10-virtualenv'E: Couldn't find any package by regex 'python3.10-virtualenv'

My sudo apt-get update also looks suspicious, but i am not entirely sure if it is the culprit

sudo apt updateHit:1 http://archive.ubuntu.com/ubuntu focal InRelease                                                 Hit:2 http://security.ubuntu.com/ubuntu jammy-security InRelease                                       Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease                                         Hit:4 http://archive.ubuntu.com/ubuntu focal-security InRelease                  Hit:5 https://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu jammy InReleaseHit:6 http://archive.ubuntu.com/ubuntu focal-backports InReleaseHit:7 http://archive.ubuntu.com/ubuntu jammy InReleaseHit:8 http://archive.ubuntu.com/ubuntu jammy-updates InReleaseReading package lists... DoneBuilding dependency tree... DoneReading state information... Done8 packages can be upgraded. Run 'apt list --upgradable' to see them.W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Translations (main/i18n/Translation-en_SG) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target Translations (main/i18n/Translation-en_SG) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11 (main/dep11/Components-amd64.yml) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11 (main/dep11/Components-all.yml) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11-icons-small (main/dep11/icons-48x48.tar) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11-icons (main/dep11/icons-64x64.tar) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target DEP-11-icons-hidpi (main/dep11/icons-64x64@2.tar) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:13 and /etc/apt/sources.list:14

I also have already added the deadsnakes ppa repos. I noticed some other questions were for python 3.6 or 3.8, which had worked in the past when i was using python 3.6 and 3.8 respectively. However, the methods described within does not work for my current setup with Ubuntu 22.04 and python3.10.

  1. python3.8-venv not working with python3.8 -m venv env
  2. python3.8-venv is no longer working after Pop OS upgraded to 21.04
  3. Trouble Installing Python3.6 Virtual Environment on Ubuntu 22.04

These are the other links that I have consulted but did not work for me. I have also tried reinstalling python3.10 itself.

  1. How to use Python3.10 on Ubuntu?
  2. Trouble Installing Python3.6 Virtual Environment on Ubuntu 22.04
  3. pyvenv not working because ensurepip is not available
  4. pyvenv not working because ensurepip is not available
  5. https://askubuntu.com/questions/879437/ensurepip-is-disabled-in-debian-ubuntu-for-the-system-python
  6. Python3.10 source venv has changed

Q: How to install python3.10 virtual environment when python3.10-venv has no installation candidate?


Viewing all articles
Browse latest Browse all 7072

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>