6

This problem has been torturing me for 2 days, and without python3-dev I can't pip install any module, can someone tell how could I solve this?

The following packages have unmet dependencies:
     python3-dev : Depends: python3 (= 3.5.1-3) but 3.5.1-4 is to be installed
                   Depends: libpython3-dev (= 3.5.1-3) but it is not going to be installed
                   Depends: python3.5-dev (>= 3.5.1-2~) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.
4
  • Did you try sudo apt-get install -f? Commented Oct 19, 2018 at 7:14
  • What does apt policy python3 python3-dev output? Commented Oct 19, 2018 at 10:56
  • 1
    This is problem with the apt ubuntu/debian package manager being in an inconsistent state. The question belongs on the askubuntu stackexchange site. How do I resolve The following packages have unmet dependencies Commented Oct 19, 2018 at 11:26
  • 1
    First of all run apt update after try apt remove python3 and now try to install python3-dev. Commented Oct 20, 2018 at 1:35

3 Answers 3

5

You can try to install package libpython3-dev instead of installing package python3-dev.

I have answered a similar question here: https://superuser.com/a/1407453/1000196

Sign up to request clarification or add additional context in comments.

Comments

2

I found a solution like this for myself on Ubuntu Desktop 20.04:

Go to "Software & Updates" application -> Then change your "Download from" server to "Main server". After this close and go terminal. Then sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove && sudo apt install python3-dev -y

Comments

0

I met this issue, and I fixed it with steps below:

  1. I tried to install libpython3-dev or python3.7-dev, it told me that "Depends: libexpat1-dev but it is not going to be installed"
  2. So I tried to install libexpat1-dev, it told me that "Depends: libexpat1 (= 2.2.6-2+deb10u4) but 2.2.6-2+deb10u1 is to be installed"
  3. Then I update libexpat1 version to 2.2.6-2+deb10u4 with command "sudo apt-get install libexpat1=2.2.6-2+deb10u4"
  4. Next, I installed libexpat1-dev, python3.7-dev, python3-dev with command below:
sudo apt-get install libexpat1-dev
sudo apt-get install python3.7-dev
sudo apt-get install python3-dev

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.