Plone 5.2 with python3: Python.h is wrongly claimed to be missing [RESOLVED]

  • Context:

    • Linux Mageia 7
    • Plone-5.2.0-UnifiedInstaller
  • Problem: when the installer is run with --with-python=/usr/bin/python3 option (BTW, the README.rst file wrongly says to use --with-python/usr/bin/python3), it claims Python.h is missing:

    Testing /usr/bin/python3 for Zope/Plone requirements....
    Failed: We need to be able to use Python.h, which is missing.
    You may be able to resolve this by installing the python-dev package.

    but that's not the case:

    $ urpmf Python.h | grep python3 | grep devel
    python3-cxx-devel:/usr/include/CXX/WrapPython.h
    lib64python3-devel:/usr/include/python3.7m/Python.h
    

    BTW, the path to python3 given to --with-python option is the right one:

    $ which python3
    /usr/bin/python3
    
  • Question: Is there a workaround, e.g. a way to specify to the installer where Python.h can be found?

Hi Denis – maybe you need to set an environment variable (I forget the name of it) that the compiler uses to find include files since that path to the .h file looks nonstandard.

Hi Kim. That's an excellent idea but I have no clue about this environment variable :slight_smile: and about the compiler you mentioned.

I had the same error sometime ago. The Python.h header was only available in the python3.<x>m and not in the python3.<x>

I am not an expert but from what I read it seems usually the both version the m and non-m are a hardlinks. Check if they are the same inode with ls -i python3.7 python3.7m

If that's not the case you could try to install Plone with:
--with-python=/usr/bin/python3.7m

I don't know how to analyze it but here is the result of the check:

$ ls -i /usr/bin/python3.7 /usr/bin/python3.7m
529639 /usr/bin/python3.7  582128 /usr/bin/python3.7m

Anyway, I wasn't very optimistic since:

$ ls -l ll /usr/bin/python3.7
lrwxrwxrwx 1 root root 10 avril  4 10:56 /usr/bin/python3.7 -> python3.7m

And, indeed:

$ ./install.sh standalone --with-python=/usr/bin/python3.7m

Testing /usr/bin/python3.7m for Zope/Plone requirements....
Failed: We need to be able to use Python.h, which is missing.
You may be able to resolve this by installing the python-dev package.

/usr/bin/python3.7m does not meet the requirements for Zope/Plone.

Anyway, thanks!

Check to make sure you're using "r1" or "r2" of the installer, as this should be fixed in those revisions. If you're using one of those and still have the problem, file a ticket at https://github.com/plone/Installers-UnifiedInstaller/issues .

Works niceley, thanks!

1 Like

I failed to indicate that the "r2" installer is missing the packages subdirectory.