Bug 1843 - python3 fails to build pure python modules
: python3 fails to build pure python modules
Product: Desktop Bugs
Classification: ROSA Desktop
Component: Main Packages
: Fresh
: All Linux
: Normal normal
: ---
Assigned To: ROSA Linux Bugs
: ROSA Linux Bugs
Depends on:
  Show dependency treegraph
Reported: 2013-03-28 15:16 MSK by Anton Kirilenko
Modified: 2013-03-29 12:07 MSK (History)
2 users (show)

See Also:
RPM Package:
Bad POT generating:
vladimir.potapov: qa_verified+
alex.burmashev: published+


Note You need to log in before you can comment on or make changes to this bug.
Description Anton Kirilenko 2013-03-28 15:16:20 MSK
Description of problem:
Python3 has its pyconfig.py module in /usr/include/multiarch-*/pyconfig.py (because of special lines in spec file), but no one said about it to distutils which looks for /usr/include/pyconfig.py. So, sysconfig can not correctly  read python3 configs.

The same problem in Mageia: https://bugs.mageia.org/show_bug.cgi?id=9395

Version-Release number of selected component (if applicable):

Steps to Reproduce:
1. Download some python module that has to be compiled (for example, Cython)
2. python3 setup.py build
3. Lots of "undefined reference to ..." will be shown because of insufficient gcc options.
Comment 1 Anton Kirilenko 2013-03-28 15:18:56 MSK
Distutils can now read pyconfig.h correctly

i586:   https://abf.rosalinux.ru/build_lists/1045098
x86_64: https://abf.rosalinux.ru/build_lists/1045099
Comment 2 Anton Kirilenko 2013-03-28 16:39:35 MSK
Detailed steps to reproduce:
cd /tmp
wget https://pypi.python.org/packages/source/C/Cython/Cython-0.18.tar.gz#md5=6a72d14e72f3df597b34ac326152f8d2
tar -zxvf Cython-0.18.tar.gz
cd Cython-0.18/
python3 setup.py build

Enjoy! ;)
Comment 3 Vladimir Potapov 2013-03-28 17:42:06 MSK
After update:

$ python3 setup.py build
Traceback (most recent call last):
  File "/usr/lib/python3.3/distutils/sysconfig.py", line 449, in _init_posix
    with open(filename) as file:
FileNotFoundError: [Errno 2] No such file or directory: '/usr/include/multiarch-i686-linux/python3.3m/pyconfig.h'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 257, in <module>
    compile_cython_modules(cython_profile, cython_compile_more, cython_with_refnanny)
  File "setup.py", line 119, in compile_cython_modules
    from Cython.Distutils import build_ext as build_ext_orig
  File "/home/keleg/1/Cython/Distutils/__init__.py", line 1, in <module>
    from Cython.Distutils.build_ext import build_ext
  File "/home/keleg/1/Cython/Distutils/build_ext.py", line 56, in <module>
    optimization = Optimization()
  File "/home/keleg/1/Cython/Distutils/build_ext.py", line 36, in __init__
    self.state = sysconfig.get_config_vars(*self.flags)
  File "/usr/lib/python3.3/distutils/sysconfig.py", line 529, in get_config_vars
  File "/usr/lib/python3.3/distutils/sysconfig.py", line 456, in _init_posix
    raise DistutilsPlatformError(my_msg)
distutils.errors.DistutilsPlatformError: invalid Python installation: unable to open /usr/include/multiarch-i686-linux/python3.3m/pyconfig.h (No such file or directory)
Comment 4 Anton Kirilenko 2013-03-28 18:16:05 MSK
Sorry, multiarch directory path was incorrect for x86 systems.

Distutils can now read pyconfig.h correctly

i586:   https://abf.rosalinux.ru/build_lists/1045191
x86_64: https://abf.rosalinux.ru/build_lists/1045192
Comment 5 Vladimir Potapov 2013-03-29 08:54:13 MSK
******************** Advisory *******************
Distutils can now read pyconfig.h correctly
QA Verified