LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Gentoo (https://www.linuxquestions.org/questions/gentoo-87/)
-   -   how to reinstall missing python header files on gentoo? (https://www.linuxquestions.org/questions/gentoo-87/how-to-reinstall-missing-python-header-files-on-gentoo-4175539470/)

pusrob 04-12-2015 08:00 AM

how to reinstall missing python header files on gentoo?
 
Hi.

This thread is a follow-up of this one. This problem is far more general than first thought, as it does not only affect pidgin (see linked thread), but many other packages as well, hence the new thread.

So the problem is, that right now I have at least 2 (possibly more) missing python header files: python.h and pyconfig.h. This prevents me from (r)emereging certain packages, like pidgin and dev-python/setuptools and possibly many others that need one of these header files.

Thus my questions are:
- how to reinstall these header files?
- which package(s) provide these header files?
- how to reinstall all python related packages?

FYI: eselect-ing another active python version and then running python-updater does not help.

Thanks in advance.

Pearlseattle 04-15-2015 02:38 PM

Hi

(didn't read your other thread)
pyconfig.h:
"emerge python" should be enough, no?

python.h
I do have a few versions of Python installed on Gentoo on a couple of PCs/notebooks, but I don't have that file ("find / -name python.h").
For what do you need it?

pusrob 04-15-2015 04:32 PM

Hi.
Thanks for the reply.

Well, as it turns out, I too have pyconfig.h and it seems to be in the right place. Unfortunately, when I try to recompile pygobject, it doesn't look for this header file in the right location. The header file is in /usr/include/python2.7/pyconfig.h but for some unknown reason when pygobject compiles, it looks for it in /usr/bin/include/python2.7/pyconfig.h which path obviously does not exist. How can I fix that? Is there a way to reset it?

python.h is needed for Pidgin recompilation, although I'm not sure why. While pygobject compilation fails at the initial checking phase, pidgin fails after some compilation. By checking the last few lines of the process it is obvious again, that the compiler looks for python files at the wrong location (path with bin). Very strange...

pusrob 04-16-2015 06:19 AM

Hi guys!

I'm not sure if it is a real solution, but creating a symlink of /usr/include to /usr/bin seems to have solved all my problems. Everything compiles now as it should. Maybe it is only a workaround, but hey, it works.

A real solution would still be much appreciated.

Thanks.

Pearlseattle 04-18-2015 09:57 AM

Yup, that's strange.
Which version of pygobject are you trying to emerge (and with which use-flags)?
And with which python version? (which one is active in "eselect python list")

I can try to emerge the same and see how it goes.

pusrob 04-19-2015 12:38 PM

Hi.

I'm currently using python3.3 as default, although changing that to 3.4 or 2.7 (originally it was set to 2.7) does not help. Not even with running python-updater (it says everything is OK) after each change.

I tried to compile pygobject 3.14.0 with the cairo, python_targets_python2_7 and python_targets_python3_3 use-flags.

I suspect that some global python path setting got mixed up somewhere, and that is what I should find and correct. I just have no idea where it is...
The good news is, that the workaround works flawlessly so far, so I'm not rushed to make the proper fix :)

Pearlseattle 04-19-2015 03:31 PM

So, I have emerged 3.14.0 (on amd64 arch) with the use-flags "cairo python2_7 python3_3 python3_4" (currently selected 3.3 in eselect) and didn't have any problems while emerging.

Code:

# eix pygobject
dev-python/pygobject
    Available versions: 
    (2)    2.28.6-r55
    (3)    3.12.2 3.14.0
      {+cairo examples libffi test +threads PYTHON_TARGETS="python2_7 python3_3 python3_4"}
    Installed versions:  2.28.6-r55(2)(19:19:58 02/18/15)(-examples -libffi -test PYTHON_TARGETS="python2_7") 3.14.0(3)(21:50:32 04/19/15)(cairo -examples -test -threads PYTHON_TARGETS="python2_7 python3_3 python3_4")
    Homepage:            https://wiki.gnome.org/Projects/PyGObject

Locations:
Code:

# find / -name pyconfig.h
/usr/include/python2.7/pyconfig.h
/usr/include/python3.3/pyconfig.h
/usr/include/python3.4/pyconfig.h
/usr/lib64/openoffice/program/python-core-2.7.6/include/python2.7/pyconfig.h
/var/tmp/portage/dev-util/kdevelop-python-1.5.2/work/kdev-python-v1.5.2/python-src/pyconfig.h
/var/tmp/portage/dev-util/kdevelop-python-1.6.0/work/kdevelop-python-1.6.0_build/python-src/pyconfig.h

If the setup is the same for you then some symlink is missing OR the Pidgin package looks for something that does not exist.
I would tend to exclude the 2nd possibility - many people would have complained by now.
Concerning case #1: how can I look for symlinks that point to that file or to its parent directory?

Otherwise you could just postpone all this stuff - whenever some other installation wants to overwrite your symlink you'll get a warning and you'll have to delete it manually.

pusrob 04-19-2015 06:20 PM

Well, it went smoothly for you. This much I expected. I really think some variable or something got mixed in my system, and that was causing all the python related troubles. All these errors got nothing to do with actual packages.

Thus as long as there are no extra troubles, I think I'll just postpone the stuff, as the symlink I created seems to be quite harmless.

Thanks for your help anyway.

Pearlseattle 04-19-2015 06:57 PM

You're welcome! :D
Don't forget to mark the thread as solved, yo! :D

pusrob 04-19-2015 07:16 PM

Sure thing :) . Marked as solved.


All times are GMT -5. The time now is 09:56 AM.