asdf-python icon indicating copy to clipboard operation
asdf-python copied to clipboard

No module named '_ctypes' error for Python 3.7 with Mac Pro M1

Open JIAZHEN opened this issue 4 years ago • 4 comments

Hi,

I installed python 3.7.12 with asdf. Then do pip3 install ansible throws error

Collecting ansible
  Using cached ansible-4.6.0.tar.gz (35.6 MB)
    ERROR: Command errored out with exit status 1:
     command: /Users/jiazhenxie/.asdf/installs/python/3.7.12/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/bm/fm54b4w52kx6w2zhs25qws6c0000gp/T/pip-install-eu4cewr3/ansible/setup.py'"'"'; __file__='"'"'/private/var/folders/bm/fm54b4w52kx6w2zhs25qws6c0000gp/T/pip-install-eu4cewr3/ansible/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/bm/fm54b4w52kx6w2zhs25qws6c0000gp/T/pip-pip-egg-info-p783eyl2
         cwd: /private/var/folders/bm/fm54b4w52kx6w2zhs25qws6c0000gp/T/pip-install-eu4cewr3/ansible/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/Users/jiazhenxie/.asdf/installs/python/3.7.12/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
        from setuptools.dist import Distribution
      File "/Users/jiazhenxie/.asdf/installs/python/3.7.12/lib/python3.7/site-packages/setuptools/dist.py", line 34, in <module>
        from setuptools import windows_support
      File "/Users/jiazhenxie/.asdf/installs/python/3.7.12/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
        import ctypes
      File "/Users/jiazhenxie/.asdf/installs/python/3.7.12/lib/python3.7/ctypes/__init__.py", line 7, in <module>
        from _ctypes import Union, Structure, Array
    ModuleNotFoundError: No module named '_ctypes'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Is it a known issue with asdf python 3.7?

JIAZHEN avatar Sep 22 '21 15:09 JIAZHEN

I'm seeing this on M1 as well, with other dependencies. The specific dependency it's failing to install at the moment is ruamel.yaml.clib and I've seen it with others.

(Also, for completeness I should note I did not install Python 3.7 on my M1 via asdf; I just found your issue here while searching for solutions.)

pbx avatar Oct 20 '21 20:10 pbx

I'm having the same issue with python3.7 + asdf, but no Manjaro Linux

naps62 avatar Dec 22 '21 10:12 naps62

Same issue here, python 3.9 and also 3.11 + asdf and Ubuntu.

xmsanchez avatar Sep 29 '23 11:09 xmsanchez