0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ModuleNotFoundError: No module named '_ctypes'

Posted at

pyenvのインストールで、ModuleNotFoundError: No module named '_ctypes'が出た時。

pyenv install 3.7.4
Downloading Python-3.7.4.tar.xz...
-> https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
Installing Python-3.7.4...

BUILD FAILED (Ubuntu 18.04 using python-build 2.3.12-16-gc8daaa39)

Inspect or clean up the working tree at /tmp/python-build.20230214083324.13541
Results logged to /tmp/python-build.20230214083324.13541.log

Last 10 log lines:
  File "/tmp/tmplfm0akzd/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/commands/__init__.py", line 6, in <module>
  File "/tmp/tmplfm0akzd/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/commands/completion.py", line 6, in <module>
  File "/tmp/tmplfm0akzd/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/cli/base_command.py", line 20, in <module>
  File "/tmp/tmplfm0akzd/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/download.py", line 37, in <module>
  File "/tmp/tmplfm0akzd/pip-19.0.3-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
  File "/tmp/python-build.20230214083324.13541/Python-3.7.4/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Makefile:1132: recipe for target 'install' failed
make: *** [install] Error 1

解決策①

sudo apt update
sudo apt install zlib1g-dev
pyenv install 3.7.4

解決策②

sudo apt install make build-essential libssl-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
pyenv install 3.7.4
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?