5

I try to install python3-venv package with apt-get by following comand:

sudo apt-get install python3-venv

But i get some errors:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 python3-venv : Depends: python3.5-venv (>= 3.5.1-2~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I also try to do this command:

sudo apt-get update
sudo apt-get upgrade

But it is not working, so i try to install python3-venv by aptitude end i also get this error. Could someone help me with this. Becouse i want to use venv, but i have not this package installed yet.

Vladyslav
  • 151

3 Answers3

3

I may be wrong, but venv supposed to be in default Python distribution try to check it by running

 python3 -m venv 

If it fails, you need to specify subversion of Python. If you are on Python 3.6, try to run

 sudo apt-get install python3.6-venv  

If you are on Ubuntu 16.04, then by default you should have Python 3.5. Run

 sudo apt-get install python3.5-venv   
1

Try:

sudo aptitude install <packagename>

It may not solve the problem but it may give you more explainded output about the problem and recommendations for fixing it. Also you may try with -f option which means:

Try hard to fix the dependencies of broken packages, even if it means ignoring the actions requested on the command line (man page).

0

try this :

sudo apt-get install virtualenv

it will setup python3-virtualenv

Gahan
  • 543