asdf-community / asdf-python

Python plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
651 stars 56 forks source link

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

Open JIAZHEN opened 2 years ago

JIAZHEN commented 2 years ago

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?

pbx commented 2 years ago

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.)

naps62 commented 2 years ago

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

xmsanchez commented 11 months ago

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

dmchmk commented 6 months ago

Python 3.10.0 on Ubuntu, same for me