Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
67
Help us understand the problem. What is going on with this article?
@hitochan777

pyenvで3.7系のインストールに失敗したときのメモ

More than 1 year has passed since last update.

エラー内容

3.6系までは普通にインストールできていたのに、3.7をインストールしようとしたら次のようなエラーでインストールに失敗。
ちなみにOSはUbuntu 18.04です。

$ pyenv install 3.7.0
Installing Python-3.7.0...

BUILD FAILED (Ubuntu 18.04 using python-build 1.2.3-79-gc057a80c)

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

Last 10 log lines:
  File "/tmp/tmppm_d6i5e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 42, in <module>
  File "/tmp/tmppm_d6i5e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/cmdoptions.py", line 16, in <module>
  File "/tmp/tmppm_d6i5e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 25, in <module>
  File "/tmp/tmppm_d6i5e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", line 39, in <module>
  File "/tmp/tmppm_d6i5e/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
  File "/tmp/python-build.20180708190520.14846/Python-3.7.0/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Makefile:1122: recipe for target 'install' failed
make: *** [install] Error 1

解決方法

libffi-devを入れることで解決

$ sudo apt install libffi-dev

CentOS系では以下aptの代わりにyumを実行します。

sudo yum install libffi-devel

Macでつまった時の話

Macでは「opensslがない」みたいなエラーが出ました。このブログが参考になりました。
どうやら、もとから入っているpythonはopensslなしでコンパイルされたものらしいです。

67
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
hitochan777
GraphQL, React, Vue, Node.js

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
67
Help us understand the problem. What is going on with this article?