This is the result I get when trying to install pip3.
sudo apt-get install python3-pip
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:
gnome-session-common : Breaks: eog (< 3.36.0) but 3.26.1-1 is to be installed
kali-menu : Breaks: python-faraday (< 3.10.0)
python3-pip : Depends: python3-distutils but it is not going to be installed
Depends: python3-setuptools but it is not going to be installed
Recommends: build-essential but it is not going to be installed
Recommends: python3-dev (>= 3.2) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
This error can be caused by an incomplete package installation.
Try:
sudo apt-get update && sudo apt-get upgrade
Then run the install command again.
sudo apt-get install python3-pip
Related
sudo apt install libpq-dev python3-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3-dev is already the newest version (3.10.6-1).
python3-dev set to manually installed.
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:
libpq-dev : Depends: libpq5 (= 14.5-1ubuntu1) but 15.1-1.pgdg22.10+1 is to be installed
E: Unable to correct problems, you have held broken packages.
You have to reinstall the libpq5 with the correct version required by libpq-dev.
sudo apt install libpq5=14.5-1ubuntu1
Then try to install the libpq-dev.
This might be long but please bear with me till the end
When I tried to install python3-venv while following this article
sudo apt install build-essential libssl-dev libffi-dev python3-dev
It threw the following error:
libffi-dev python3-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libffi-dev is already the newest version (3.3-4).
build-essential is already the newest version (12.8ubuntu1.1).
libssl-dev is already the newest version (1.1.1f-1ubuntu2.16).
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-dev : Depends: libpython3-dev (= 3.8.2-0ubuntu2) but it is not going to be installed
Depends: python3.8-dev (>= 3.8.2-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
So instead of python3-dev, I tried python3 only and it ran.
After that, I ran this command:
sudo apt install -y python3-venv
Then it gave me this:
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.8-venv (>= 3.8.2-1~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
So I thought maybe I need to install python3.8-venv, so I did:
sudo apt install -y python3.8-venv
AND, it gave me this error:
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.8-venv : Depends: python3.8 (= 3.8.10-0ubuntu1~20.04.5) but 3.8.13-1+bionic2 is to be installed
E: Unable to correct problems, you have held broken packages.
THEN, I tried:
sudo apt install -y python3.8
which was fine and gave me this
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3.8 is already the newest version (3.8.13-1+bionic2).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
I don't know what to do, my virtual env isn't working, I read somewhere that it's pre-installed so I also tried directly creating a virtual env with
python3 -m venv myEnv
Which again gave me this:
Error: Command '['/home/yash/Desktop/DashMed/myEnv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
which upon googling said to install python3-venv which I've already failed in
SO I AM STUCK IN THIS LOOP
PLEASE HELP
The main reason for these issues was the version of python3.8
I had version 3.8.13-1+bionic2 but we needed 3.8.10-0ubuntu1~20.04.5
I think this generally occurs when you upgrade from Ubuntu 18.04 LTS to Ubuntu 20.04 LTS using in-built Software & Updates
So I found this command which rolled back the versions now everything works fine
sudo apt install libpython3.8:amd64=3.8.2-1ubuntu1 libpython3.8-dev:amd64=3.8.2-1ubuntu1 libpython3.8-minimal:amd64=3.8.2-1ubuntu1 libpython3.8-stdlib:amd64=3.8.2-1ubuntu1 python3.8=3.8.2-1ubuntu1 python3.8-minimal=3.8.2-1ubuntu1
After this, all those other commands ran perfectly on my system
I found this rollback command here
I am trying to install pygame on an Ubuntu 16.04 system. My default python is 2.7.12. I opened terminal and tried:
sudo apt-get install python-pygame
I got this message:
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:
python-pygame : Depends: python-numpy (>= 1:1.8.0) but it is not going to be installed
Depends: python-numpy-abi9
E: Unable to correct problems, you have held broken packages.
I then tried to install numpy and got the same message except:
The following packages have unmet dependencies:
python-numpy : Depends: python:any (>= 2.7.5-5~)
What should I do?
Figured it out. Found a terminal command to reinstall python:
sudo apt-get purge python && sudo apt-get install python2.7
sudo apt-get install -f
it fixes the broken dependencies
This is the command I used to install python-pip
sudo apt-get install python-pip
I get the following error
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:
python-pip : Depends: python-setuptools (>= 0.6c1) but it is not going to be installed
Recommends: python-dev-all (>= 2.6) but it is not installable
E: Unable to correct problems, you have held broken packages.
I already installed the latest version of python-dev
When i try to install python-setuptools using
sudo apt-get install python-setuptools I get the below error
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:
python-setuptools : Depends: python-pkg-resources (= 3.3-1ubuntu1) but 3.3-1ubuntu2 is to be installed
E: Unable to correct problems, you have held broken packages.
Explain me how to resolve the error and guide me the steps to get python-pip installed.
got the same error when I install python-pip, the following command solved my problem.
sudo apt-get install python-pkg-resources=3.3-1ubuntu1
sudo apt-get install python-setuptools
download pip from https://bootstrap.pypa.io/get-pip.py
Then run the following (which may require administrator access):
python get-pip.py
This should get you going.
If you get stuck again, read here: http://pip.readthedocs.org/en/stable/installing/
In addition to the solution that #seems recommended, I had to run this.
apt-get update
(OR)
sudo apt-get install python-setuptools python-dev build-essential
sudo easy_install pip
i have the same issue, and eventually i gave up by using:
sudo apt-get install python-pip
after tryings something like:
sudo apt-get install python-setuptools python-dev build-essential
but with no luck.
So all i did then was to:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
peace of mind.....
I think you should try:
sudo apt-get install python-pkg-resources=3.3-1ubuntu1
And then:
sudo apt-get install python-pip python-dev build-essential
It will definitely solve your issue.
Jut run this command :
sudo apt-get update
than install python tools :
sudo apt-get install python-pip
sudo apt-get install python-dev
sudo apt-get install build-essential
All the packages will get installed or some of them may say its already latest version, Thats fine
I am trying to install the python package matplotlib from source. I cannot install the package from the repository using sudo apt-get install python-matplotlib because I need to be able to install the package in a virtualenv using a requirmenets.txt file. When I follow the instructions to install dependencies I get the following error:
vagrant#vagrant-ubuntu-trusty-64:~$ sudo apt-get build-dep python-matplotlib
Reading package lists... Done
Building dependency tree
Reading state information... Done
Picking 'matplotlib' as source package instead of 'python-matplotlib'
The following packages have unmet dependencies:
python3-all-dbg : Depends: libpython3-all-dbg (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3-dbg (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3.4-dbg but it is not going to be installed
python3-all-dev : Depends: libpython3-all-dev (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3-dev (= 3.4.0-0ubuntu2) but it is not going to be installed
Depends: python3.4-dev but it is not going to be installed
python3-numpy-dbg : Depends: python3-dbg but it is not going to be installed
E: Build-dependencies for python-matplotlib could not be satisfied.
How do I fix the problem? I have already run sudo apt-get update and
sudo apt-get upgrade to no avail. Could I just directly install the dependencies listed in the error message (I thought that was the point of the command)? I am not even using Python 3 so not concerned about having the packages installed (though not sure why I need them either). When I try running pip install -r requirements.txt in the virtual environment I still get an error on installing matplotlib.
Generally you get this message when you're missing some repository - you could check the list of your active repo from /etc/apt/sources.list. In your case you might miss the -srcrepo
What is strange is that python3-dev is from main repo so it should be activated by default.
You can add repo by editing the file /etc/apt/sources.list
sudo vi /etc/apt/sources.list
and add the following lines
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://br.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
You can get more info about the available repo from this link
make sure to (re)run sudo apt-get update after you've done this change and you should be ok to install your dependencies