What to do if you get an error when installing python with pyenv

environment

Symptoms

When I tried to install python with pyenv, it failed with the following error.

$ pyenv install 2.7.xx

Installing Python-2.7.xx...

ERROR: The Python zlib extension was not compiled. Missing the zlib?

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

BUILD FAILED

approach

According to the page written in the message, you can enter the following.

$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 2.7.xx

If this doesn't help, it says to reinstall the XCode command line tools.

$ xcode-select --install

Recommended Posts

What to do if you get an error when installing python with pyenv
What to do if you get an OpenSSL error when installing Python 2 with pyenv
What to do if you get an error when installing Dlib (Ubuntu)
What to do if you get an Undefined error when trying to use pip with pyenv
What to do if you get an error when importing matplotlib in Python (Mac)
What to do if you get an Import Error when importing matplotlib with Jupyter
What to do if you get an error when trying to load mnist
What to do if you run python in IntelliJ and end with an error
What to do if you get an error when running "certbot renew" in CakePHP environment
What to do if you couldn't send an email to Yahoo with Python.
What to do if pyenv install does not proceed with an error
What to do if an error occurs when importing numpy with VScode
What to do if you get the error "Error: opencv3: Does not support building both Python 2 and 3 wrappers" when installing openCV 3
Workaround if you get an error when trying to install PySide with pip
What to do when an error occurs with import _ssl
What to do if you get an error like'Qstring' has already been set to version 1 using mne python
What to do if you get a "Wrong Python Platform" warning when using Python with the NetBeans IDE
What to do if you get an "unknown service" error from your gRPC server
What to do if you get a memory error when converting from PySparkDataFrame to PandasDataFrame
What to do if you get the error ʻERR_FEATURE_UNAVAILABLE_ON_PLATFORM` when using ts-node-dev on Linux
What to do if you can't install pyaudio with pip #Python
What to do if you get a minus zero in Python
[Beanstalk] What to do when an error occurs with import uuid
What to do if you get a UnicodeDecodeError with pip install
What to do if an error occurs when loading a python project created with poetry into VS Code
What to do when you get an error saying "Name resolution temporarily failed" on linux
What to do if you get Swagger-codegen in python and Import Error: No module named
[Python] What to do when an error related to SSL authentication is returned
What to do if you get a TypeError with numpy min, max
What to do if you get Could not fetch URL 443 with pip
[OSX] [pyenv] What to do when an SSL error occurs in pip
What to do if you get an error saying c compiler cannot create executables in configure
What to do if you get a must override `get_config` error when trying to model.save in Keras
What to do if you get angry if you don't have libxml / xmlversion.h when installing lxml on CentOS
What to do if pip --user returns an error in a virtual environment created with pyenv
What to do if you get an error when vagrant up when you enable public_network or private_network on Vagrant + Arch Linux → Install netctl
When you get an error in python scraping (requests)
What to do when you can't bind CaboCha to Python
[Python] What to do if an error occurs in pip (pyinstaller, pyautogui, etc.)
What to do if you get a "No versions found" error in pipenv
What to do if you get angry with swapon failed: Operation not permitted
[python] What to do when an error occurs in send_keys of headless chrome
What to do if you get "Python not configured." Using PyDev in Eclipse
[Python] What to check when you get a Unicode Decode Error in Django
If you get a long error when tabbing an interactive shell with Anaconda
What to do if you get "The session could not be opened" when installing CentOS on VirtualBox
What to do if you get a Permission denied (public key) error when trying to pull on Github
[Python] What to do if you get a ModuleNotFoundError when importing pandas using Jupyter Notebook in Anaconda
What to do if you get the error Target WSGI script'/var/www/xxx/xxx.wsgi' cannot be loaded as python module
EC2 / Amazon Linux2: What to do if you get an "unable to execute'gcc': No such file or directory" error with pip install
What to do with PYTHON release?
Python | What you can do with Python
[AWS] What to do when you want to pip with Lambda
What to do if you get "coverage unknown" in Coveralls
What to do if you can't sort files with subscripts
What to do if you get `No kernel for language python found` in Hydrogen
What to do if the print command itself causes an error in Maya python
What to do if you get "(35,'SSL connect error')" in pycurl (one of them)
How to install and use pyenv, what to do if you can't switch python versions
I get an error when I try to raise Python to 3 series using pyenv on Catalina
I get an error when trying to install maec 4.0.1.0 with pip