LoginSignup
2
1

More than 5 years have passed since last update.

pyenvでpython3.7.1のインストール時にOpenSSL関連のエラーが起こったときの対応メモ

Posted at

自分用メモ書きです。(原因の究明とかはしてません)
Scrapboxからコピペして軽く整えただけなのでガタガタですごめんなさい。
(いい感じのConverter作って欲しい…)

環境

OS: OSX 10.14
shell: fish

内容

<USER_NAME>で伏せてあります。

 $ pyenv install 3.7.1
 WARNING: Please make sure you remove any previous custom paths from your /Users/<USER_NAME>/.pydistutils.cfg file.
 python-build: use openssl from homebrew
 python-build: use readline from homebrew
 Downloading Python-3.7.1.tar.xz...
 -> https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
 Installing Python-3.7.1...
 python-build: use readline from homebrew
 WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
 WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
 ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?

 Please consult to the Wiki page to fix the problem.
 https://github.com/pyenv/pyenv/wiki/Common-build-problems


 BUILD FAILED (OS X 10.14 using python-build 20180424)

 Inspect or clean up the working tree at /var/folders/rs/108hnn390c78m9xl5_4sjsj00000gn/T/python-build.20181208004703.47142
 Results logged to /var/folders/rs/108hnn390c78m9xl5_4sjsj00000gn/T/python-build.20181208004703.47142.log

 Last 10 log lines:
            install|*) ensurepip="" ;; \
        esac; \
         ./python.exe -E -m ensurepip \
            $ensurepip --root=/ ; \
    fi
 Looking in links: /var/folders/rs/108hnn390c78m9xl5_4sjsj00000gn/T/tmpifms82py
 Collecting setuptools
 Collecting pip
 Installing collected packages: setuptools, pip
 Successfully installed pip-18.1 setuptools-40.6.2

対応

エラー内容の中のURLを参照していかの対応をした

[https://github.com/pyenv/pyenv/wiki/Common-build-problems Common build problems · pyenv/pyenv Wiki]

$ set CFLAGS -I(brew --prefix openssl)/include
$ set LDFLAGS -L(brew --prefix openssl)/lib
$ pyenv install 3.7.1

しかしエラー内容は変わらず

ここで別の対応を発見

Python 3.7.0 :: The Python ssl extension was not compiled. Missing the OpenSSL lib? · Issue #1184 · pyenv/pyenv

$ brew install 'openssl@1.1'
$ CONFIGURE_OPTS="--with-openssl=$(brew --prefix openssl@1.1)" pyenv install 3.7.0

結局

とりあえずWARNING(WARNING: Please make sure you remove any previous custom paths from your /Users/<USER_NAME>/.pydistutils.cfg file.)に対応することに…

$ rm /Users/<USER_NAME>/.pydistutils.cfg

無事インストール完了

$ pyenv versions
* system (set by /Users/kaito/.pyenv/version)
  3.7.0

しっかりと削除してからインストールし直さなきゃダメですね…

2
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
2
1