LoginSignup
3
1

More than 3 years have passed since last update.

pyenv install 3.4.Xでerror: implicit declaration of function 'getentropy' is invalid in C99

Posted at

概要

表題の通りです。

$ pyenv install 3.4.3

python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-3.4.3.tar.xz...
-> https://www.python.org/ftp/python/3.4.3/Python-3.4.3.tar.xz
Installing Python-3.4.3...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

〜略〜

Last 10 log lines:
Python/random.c:81:19: error: implicit declaration of function 'getentropy' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        int res = getentropy(buffer, len);
                  ^
Python/random.c:81:19: note: did you mean 'py_getentropy'?
Python/random.c:77:1: note: 'py_getentropy' declared here
py_getentropy(unsigned char *buffer, Py_ssize_t size, int fatal)
^
1 error generated.
make: *** [Python/random.o] Error 1
make: *** Waiting for unfinished jobs....

error: implicit declaration of function 'getentropy' is invalid in C99というエラーが出ています。

解決方法

かなり前に同一のエラーに対してissueが立てられていました。

  1. パッチをダウンロード
  2. --patchパッチを当ててpyenv installする
$ pyenv install 3.4.3 --patch < Python-3.4.3-macos.patch
3
1
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
3
1