Opened 4 years ago

Closed 4 years ago

#62506 closed defect (duplicate)

python39: '_ctypes' module missing on 10.5

Reported by: rmottola (Riccardo) Owned by:
Priority: Normal Milestone:
Component: ports Version:
Keywords: leopard Cc: jmroot (Joshua Root)
Port: python39

Description

py39-setuptools fails with the error copied below. I tried several times. Perhaps a missing depedenecy?

--->  Building py39-setuptools
Executing:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools/py39-setuptools/work/setuptools-54.1.2" && /opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 setup.py --no-user-cfg build -j2 
Traceback (most recent call last):
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools/py39-setuptools/work/setuptools-54.1.2/setup.py", line 7, in <module>
    import setuptools
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools/py39-setuptools/work/setuptools-54.1.2/setuptools/__init__.py", line 18, in <module>
    from setuptools.dist import Distribution
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools/py39-setuptools/work/setuptools-54.1.2/setuptools/dist.py", line 34, in <module>
    from setuptools import windows_support
  File "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_python_py-setuptools/py39-setuptools/work/setuptools-54.1.2/setuptools/windows_support.py", line 2, in <module>
    import ctypes
  File "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'

I attach the build log because I noticed some tarball issues with dates, I don't think they are relevant though to this error.

Attachments (2)

py39-setuptools-main.log (64.5 KB) - added by rmottola (Riccardo) 4 years ago.
python39-ctypes-fix-gcc-no-pragmas-in-functions.diff (852 bytes) - added by kencu (Ken) 4 years ago.

Download all attachments as: .zip

Change History (8)

Changed 4 years ago by rmottola (Riccardo)

Attachment: py39-setuptools-main.log added

comment:1 Changed 4 years ago by jmroot (Joshua Root)

Port: python39 added; py39-setuptools removed
Summary: py39-setuptools : builf fails no module '_ctypes'python39: '_ctypes' module missing on 10.5

comment:2 in reply to:  description Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to rmottola:

I noticed some tarball issues with dates, I don't think they are relevant though to this error.

See #61276 about that.

comment:3 Changed 4 years ago by kencu (Ken)

So this is making a lot of trouble, as most all ports are defaulting to python39 now, but it is not working properly on 10.5, so things like py39-setuptools can't be installed.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

comment:4 Changed 4 years ago by kencu (Ken)

simple error in the end:

/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.2/Modules/_ctypes/callbacks.c: In function ‘_ctypes_alloc_callback’:
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.2/Modules/_ctypes/callbacks.c:430: warning: ignoring #pragma clang diagnostic
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.2/Modules/_ctypes/callbacks.c:431: warning: ignoring #pragma clang diagnostic
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.2/Modules/_ctypes/callbacks.c:434: error: #pragma GCC diagnostic not allowed inside functions
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.2/Modules/_ctypes/callbacks.c:435: error: #pragma GCC diagnostic not allowed inside functions
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.2/Modules/_ctypes/callbacks.c:437: warning: ‘ffi_prep_closure’ is deprecated (declared at /opt/local/include/ffi.h:343)
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.2/Modules/_ctypes/callbacks.c:440: warning: ignoring #pragma clang diagnostic
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_python39/python39/work/Python-3.9.2/Modules/_ctypes/callbacks.c:443: error: #pragma GCC diagnostic not allowed inside functions

10 second fix. I'll put a patch up here.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

Changed 4 years ago by kencu (Ken)

comment:5 Changed 4 years ago by kencu (Ken)

No doubt Josh has a better patch than just stripping the pragmas all out, so I won't try to play "guess what I'm thinking" here.

comment:6 Changed 4 years ago by jmroot (Joshua Root)

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.