3.7.3 Compile error on CentOS 7 (but 3.6.8 Compiles OK)
I am trying to compile Python 3 on Centos7 and I am getting "ModuleNotFoundError: No module named '_ctypes'" Context: Centos7 uses Python 2.7.5 for its routines, so it is need to leave original Python 2.7.5 untouched. Python 3 (in case 3.7.3) needs to be compiled for alternate install. I am downloading source from python.org and using verbatin instructions from https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos.... I just changed version to 3.7.3. The compilation of 3.7.3, 3.7.2, 3.7.1 fails with following msgs: # make && make altinstall . . File "/root/Python-3.7.3/Lib/ensurepip/__init__.py", line 27, in _run_pip import pip._internal File "/tmp/tmp8h0mvcgm/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/__init__.py", line 40, in <module> File "/tmp/tmp8h0mvcgm/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/cli/autocompletion.py", line 8, in <module> File "/tmp/tmp8h0mvcgm/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/cli/main_parser.py", line 12, in <module> File "/tmp/tmp8h0mvcgm/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/commands/__init__.py", line 6, in <module> File "/tmp/tmp8h0mvcgm/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/commands/completion.py", line 6, in <module> File "/tmp/tmp8h0mvcgm/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 20, in <module> File "/tmp/tmp8h0mvcgm/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/download.py", line 37, in <module> File "/tmp/tmp8h0mvcgm/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module> File "/root/Python-3.7.3/Lib/ctypes/__init__.py", line 7, in <module> from _ctypes import Union, Structure, Array ModuleNotFoundError: No module named '_ctypes' make: *** [altinstall] Error 1 ================================================================= But Python 3.6.8 compiles OK: changing mode of /usr/local/bin/idle3.6 to 755 changing mode of /usr/local/bin/2to3-3.6 to 755 changing mode of /usr/local/bin/pyvenv-3.6 to 755 rm /usr/local/lib/python3.6/lib-dynload/_sysconfigdata_m_linux_x86_64-linux-gnu.py rm -r /usr/local/lib/python3.6/lib-dynload/__pycache__ /bin/install -c -m 644 ./Misc/python.man \ /usr/local/share/man/man1/python3.6.1 if test "xupgrade" != "xno" ; then \ case upgrade in \ upgrade) ensurepip="--altinstall --upgrade" ;; \ install|*) ensurepip="--altinstall" ;; \ esac; \ LD_LIBRARY_PATH=/root/Python-3.6.8 ./python -E -m ensurepip \ $ensurepip --root=/ ; \ fi Looking in links: /tmp/tmpwmo1o05a Collecting setuptools Collecting pip Installing collected packages: setuptools, pip Successfully installed pip-18.1 setuptools-40.6.2 Thanks for your attention. Carlos
Hi, Le 02/07/2019 à 06:22, csotto@uol.com.br a écrit :
I am trying to compile Python 3 on Centos7 and I am getting "ModuleNotFoundError: No module named '_ctypes'"
I'm not sure that you are asking on the right mailing list. Anyway. Red Hat provides precompiled Python 3.6 for Centos 7: https://www.softwarecollections.org/en/scls/rhscl/rh-python36/ About your error, you likely miss some header files, like libffi-devel: sudo yum install -y libffi-devel Victor -- Night gathers, and now my watch begins. It shall not end until my death.
----- Original Message -----
From: "Victor Stinner"
To: python-dev@python.org Sent: Tuesday, July 2, 2019 10:41:40 AM Subject: [Python-Dev] Re: 3.7.3 Compile error on CentOS 7 (but 3.6.8 Compiles OK) Hi,
Le 02/07/2019 à 06:22, csotto@uol.com.br a écrit :
I am trying to compile Python 3 on Centos7 and I am getting "ModuleNotFoundError: No module named '_ctypes'"
I'm not sure that you are asking on the right mailing list. Anyway.
Red Hat provides precompiled Python 3.6 for Centos 7: https://www.softwarecollections.org/en/scls/rhscl/rh-python36/
About your error, you likely miss some header files, like libffi-devel:
sudo yum install -y libffi-devel
That issue has been reported some times before as well at bpo. Maybe providing a proper error message for the missing libffi headers would be good, as the current one is quite cryptic.
Victor -- Night gathers, and now my watch begins. It shall not end until my death. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/MERA4UA2...
-- Regards, Charalampos Stratakis Software Engineer Python Maintenance Team, Red Hat
FYI I also created an issue to suggest to avoid ctypes to get the glibc version in pip ;-) https://github.com/pypa/pip/issues/6675 In the past, we reported multiple times issues to pip when ctypes is not avialable (for different reasons), but it seems to be a lost battle: ctypes is commonly used (directly by pip, or by pip dependencies), so instead we try to ensure that ctypes is built on buildbots. Victor Le 02/07/2019 à 11:12, Charalampos Stratakis a écrit :
----- Original Message -----
From: "Victor Stinner"
To: python-dev@python.org Sent: Tuesday, July 2, 2019 10:41:40 AM Subject: [Python-Dev] Re: 3.7.3 Compile error on CentOS 7 (but 3.6.8 Compiles OK) Hi,
Le 02/07/2019 à 06:22, csotto@uol.com.br a écrit :
I am trying to compile Python 3 on Centos7 and I am getting "ModuleNotFoundError: No module named '_ctypes'"
I'm not sure that you are asking on the right mailing list. Anyway.
Red Hat provides precompiled Python 3.6 for Centos 7: https://www.softwarecollections.org/en/scls/rhscl/rh-python36/
About your error, you likely miss some header files, like libffi-devel:
sudo yum install -y libffi-devel
That issue has been reported some times before as well at bpo.
Maybe providing a proper error message for the missing libffi headers would be good, as the current one is quite cryptic.
Victor -- Night gathers, and now my watch begins. It shall not end until my death. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/MERA4UA2...
-- Night gathers, and now my watch begins. It shall not end until my death.
Victor, Thanks a bunch! Issue closed! It saved my day!
The FIX: "sudo yum install -y libffi-devel", fixed the 3.7.3 compile error!
Have a great day!
Carlos
-----Mensagem original-----
De: Victor Stinner
----- Original Message -----
From: "Victor Stinner"
To: python-dev@python.org Sent: Tuesday, July 2, 2019 10:41:40 AM Subject: [Python-Dev] Re: 3.7.3 Compile error on CentOS 7 (but 3.6.8 Compiles OK) Hi,
Le 02/07/2019 à 06:22, csotto@uol.com.br a écrit :
I am trying to compile Python 3 on Centos7 and I am getting "ModuleNotFoundError: No module named '_ctypes'"
I'm not sure that you are asking on the right mailing list. Anyway.
Red Hat provides precompiled Python 3.6 for Centos 7: https://www.softwarecollections.org/en/scls/rhscl/rh-python36/
About your error, you likely miss some header files, like libffi-devel:
sudo yum install -y libffi-devel
That issue has been reported some times before as well at bpo.
Maybe providing a proper error message for the missing libffi headers would be good, as the current one is quite cryptic.
Victor -- Night gathers, and now my watch begins. It shall not end until my death. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/M ERA4UA2KLZJVQ7IEMNYOTD7FCSZY24I/
-- Night gathers, and now my watch begins. It shall not end until my death. _______________________________________________ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-leave@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/python-dev@python.org/message/2UF4RQHQ...
participants (4)
-
Carlos Sotto Maior (UOL)
-
Charalampos Stratakis
-
csotto@uol.com.br
-
Victor Stinner