LoginSignup
3
0

More than 5 years have passed since last update.

Sierraにアップデート後、ENVでバージョンインストール時に失敗する対策

Last updated at Posted at 2016-09-24

SierraにアップデートしたMacで、pyenvを使ってPythonの環境を作ろうと思いました。
しかし

$ pyenv install 3.5.1

と打ち込んでも

Downloading Python-3.5.1.tar.xz...
-> https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz
Installing Python-3.5.1...

BUILD FAILED (OS X 10.12 using python-build 20160602)

Inspect or clean up the working tree at /var/folders/q0/xjdlx15d18l2ljx4_924z5vc0000gn/T/python-build.20160924145129.25939
Results logged to /var/folders/q0/xjdlx15d18l2ljx4_924z5vc0000gn/T/python-build.20160924145129.25939.log

Last 10 log lines:
  File "/private/var/folders/q0/xjdlx15d18l2ljx4_924z5vc0000gn/T/python-build.20160924145129.25939/Python-3.5.1/Lib/ensurepip/__main__.py", line 4, in <module>
    ensurepip._main()
  File "/private/var/folders/q0/xjdlx15d18l2ljx4_924z5vc0000gn/T/python-build.20160924145129.25939/Python-3.5.1/Lib/ensurepip/__init__.py", line 209, in _main
    default_pip=args.default_pip,
  File "/private/var/folders/q0/xjdlx15d18l2ljx4_924z5vc0000gn/T/python-build.20160924145129.25939/Python-3.5.1/Lib/ensurepip/__init__.py", line 116, in bootstrap
    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/private/var/folders/q0/xjdlx15d18l2ljx4_924z5vc0000gn/T/python-build.20160924145129.25939/Python-3.5.1/Lib/ensurepip/__init__.py", line 40, in _run_pip
    import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1

このようなエラー文が出て、インストールに失敗します。

対策として

$ xcode-select --install

を打ち込みます。

xcode.png

ポップが立ち上がるので、Xcodeをインストール済みの方は、インストールを押します。

インストール終了後に、

$ pyenv install 3.5.1

をもう一度打ち込むと

Downloading Python-3.5.1.tar.xz...
-> https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tar.xz
Installing Python-3.5.1...
Installed Python-3.5.1 to /Users/username/.pyenv/versions/3.5.1

username% pyenv versions
* system (set by /Users/username/.pyenv/version)
  3.5.1

無事にインストールできました。
他のENVでも、インストールが失敗されてるようでしたら試してみてください。

3
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
3
0