質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

Q&A

解決済

1回答

2584閲覧

pyenvでpythonのインストールができないことに関して

taniisei

総合スコア5

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

0グッド

1クリップ

投稿2020/12/11 10:59

前提・実現したいこと

python3系をインストールしたい
ここに質問の内容を詳しく書いてください。
(例)現在、プロゲートの記事を元にHomebrewのインストール,pyenvのインストール,Pythonのインストールを実行しているのですが、pythonのインストールでエラーが出てしまいます。
利用しているのは、macOS bigsur です。
googleで調べたのですが、わかりませんでした。どうすればいいのでしょうか
■■な機能を実装中に以下のエラーメッセージが発生しました。

発生している問題・エラーメッセージ

make: *** [Modules/posixmodule.o] Error 1 make: *** Waiting for unfinished jobs....

該当のソースコード

python-build: use openssl from homebrew python-build: use readline from homebrew Downloading Python-3.6.5.tar.xz... -> https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz Installing Python-3.6.5... python-build: use readline from homebrew python-build: use zlib from xcode sdk BUILD FAILED (OS X 11.0.1 using python-build 20180424) Inspect or clean up the working tree at /var/folders/hd/gh1gqpgx5j7_kjg0yfydxfk00000gn/T/python-build.20201211193850.57665 Results logged to /var/folders/hd/gh1gqpgx5j7_kjg0yfydxfk00000gn/T/python-build.20201211193850.57665.log Last 10 log lines: ./Modules/posixmodule.c:8210:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ret = sendfile(in, out, offset, &sbytes, &sf, flags); ^ ./Modules/posixmodule.c:10432:5: warning: code will never be executed [-Wunreachable-code] Py_FatalError("abort() called from Python code didn't abort!"); ^~~~~~~~~~~~~ clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl@1.1/include -I/Users/.pyenv/versions/3.6.5/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl@1.1/include -I/Users/.pyenv/versions/3.6.5/include -DPy_BUILD_CORE -c ./Modules/pwdmodule.c -o Modules/pwdmodule.o 1 warning and 1 error generated. make: *** [Modules/posixmodule.o] Error 1 make: *** Waiting for unfinished jobs.... ```python-build: use openssl from homebrew python-build: use readline from homebrew Downloading Python-3.6.5.tar.xz... -> https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz Installing Python-3.6.5... python-build: use readline from homebrew python-build: use zlib from xcode sdk BUILD FAILED (OS X 11.0.1 using python-build 20180424) Inspect or clean up the working tree at /var/folders/hd/gh1gqpgx5j7_kjg0yfydxfk00000gn/T/python-build.20201211193850.57665 Results logged to /var/folders/hd/gh1gqpgx5j7_kjg0yfydxfk00000gn/T/python-build.20201211193850.57665.log Last 10 log lines: ./Modules/posixmodule.c:8210:15: error: implicit declaration of function 'sendfile' is invalid in C99 [-Werror,-Wimplicit-function-declaration] ret = sendfile(in, out, offset, &sbytes, &sf, flags); ^ ./Modules/posixmodule.c:10432:5: warning: code will never be executed [-Wunreachable-code] Py_FatalError("abort() called from Python code didn't abort!"); ^~~~~~~~~~~~~ clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I. -I./Include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl@1.1/include -I/Users/.pyenv/versions/3.6.5/include -I/usr/local/opt/readline/include -I/usr/local/opt/readline/include -I/usr/local/opt/openssl@1.1/include -I/Users/.pyenv/versions/3.6.5/include -DPy_BUILD_CORE -c ./Modules/pwdmodule.c -o Modules/pwdmodule.o 1 warning and 1 error generated. make: *** [Modules/posixmodule.o] Error 1 make: *** Waiting for unfinished jobs.... ### 試したこと Homebrewのインストール pyenvのインストール 再インストール ### 補足情報(FW/ツールのバージョンなど) ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

taniisei

2020/12/12 04:09

cpuはintelCore i5 です。 quickquip様の提示してくださったurlと、他の検索した内容でインストールできました。 ありがとうございました。
guest

回答1

0

自己解決

1,下記のコマンドで、xcode-selectをインストール
xcode-select --install
2,下記のコマンドで、xcodeのパスを指定
xcode-select --switch /Applications/Xcode.app
3,下記のコマンドで、zlib bzip2をリインストール
brew reinstall zlib bzip2
4,下記のコマンドで、shellを確認
echo $SHELL
5,私は/bin/bash だったので、下記のコマンドを入力
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
source ~/.bash_profile
6,下記のコマンドで、pythonをインストール
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" pyenv install --patch 3.6.0 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch?full_index\=1)

投稿2020/12/12 04:15

taniisei

総合スコア5

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問