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
4 Answers 4
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.
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.
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).
-
python
andpython-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– Dmitry Grigoryev2017年01月18日 10:00:33 +00:00Commented Jan 18, 2017 at 10:00
Did you try sudo apt-get install python
? If you're running Raspbian, it should be installed by default.
-
The report included in the OP's question does indeed suggest that
python
replacespython-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– SlySven2016年01月03日 01:20:26 +00:00Commented Jan 3, 2016 at 1:20
Explore related questions
See similar questions with these tags.