0

I have tried to do a sudo apt-get install python-dev however I get this,

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-dev 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
However the following packages replace it:
  python

E: Package 'python-dev' has no installation candidate

I am not sure what is going wrong, although I have altered my source.list file as I was upgrading GCC to 4.8 and here is my source file.

    #deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi

deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
# Source repository to add
deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free rpi
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://archive.raspbian.org/raspbian jessie main contrib non-free rpi
# Source repository to add
deb-src http://archive.raspbian.org/raspbian jessie main contrib non-free rpi

My ultimate goal is to try and install the unqlite python module however, I get an error saying that python.h is not found or is not in directory, so I decided to google around and found that I had to install python-dev however this did not work

Johnathon64
  • 109
  • 1
  • 1
  • 2

4 Answers4

1

I see that you are mixing major distribution versions, i.e. your listing has both Raspbian 7.x (Wheezy) and 8.x (Jessie) in your sources.list files. That does not sound good to me - I would suggest that you choose one (probably Jessie) and then use dpk-query -l | grep "deb7" to identify packages that are probably specific to Wheezy and carefully try to remove/upgrade them to "deb8" ones.

For this aptitude may be more helpful than apt-get because it will tell you if multiple versions of a package is available and allow you to choose which to install - and work out if it is possible with the addition or removal of others. The only niggle with aptitude in its default interactive mode is the ncurses (text) UI which may take some getting use to if you are not familiar with it.

SlySven
  • 3,621
  • 1
  • 18
  • 45
1

python-dev package does exist in both Wheezy and Jessie. The message Package 'python-dev' has no installation candidate simply means that your system cannot satisfy all its dependencies, which often happens when you mix files from two distributions in your sources.list.

There is no way to have gcc-4.8 on Wheezy, so if you must use it, you'll have to upgrade to Jessie.

Dmitry Grigoryev
  • 27,928
  • 6
  • 53
  • 144
-1

This package hasn't got any .deb files in the repositories, but (as apt-get said) some other packages refer to it.

Also, your apt-get output says that another package replaces it. Install python package (sudo apt-get install python).

After this you can install unqlite or any other module with pip. Pip is like apt-get for python. pip install unqlite

If you get pip: command not found, execute sudo apt-get install pip

If you experience other errors, see if apt-get update fixes it (in most cases it does).

thekiwi5000
  • 651
  • 4
  • 14
  • python and python-dev are two different packages. That message just means that Python 2.7 will remove dev files from Python 2.6 and earlier versions. – Dmitry Grigoryev Jan 18 '17 at 10:00
-1

Did you try sudo apt-get install python? If you're running Raspbian, it should be installed by default.

Jacobm001
  • 11,898
  • 7
  • 46
  • 56
  • The report included in the OP's question does indeed suggest that python replaces python-dev - I would speculate that because the RPi has a higher dependency on Python to work with it's hardware the Package maintainers for the Raspbian distribution has rolled the python-dev package into the main python one which may be different from how the parent distribution (Debian) seems to do it. – SlySven Jan 03 '16 at 01:20