I can't install python3 with pyenv-vertualenv

I have been using Environment prepared in the previous article for about a year and a half.

Using pyenv-vertualenv, I encountered a problem that python 3 system could not be installed well, so I will describe the corresponding method.

Version upgrade of pyenv does not work

An error that occurred when trying to use Python 3.5.2. An error that occurs because the version of pyenv itself is old and Python3.5.2 itself does not exist in pyenv.

test_py352 $ pwd            #The directory you were working in
/Users/XXX/work/test_py352

test $ pyenv install 3.5.2
python-build: definition not found: 3.5.2

See all available versions with `pyenv install --list'.

If the version you need is missing, try upgrading pyenv:

  brew update && brew upgrade pyenv

If you update Homebrew and upgrade pyenv according to the message that appears after you type the command, it will be solved.

test_py352 $ cd ~            #Move to home directory
$ brew update
remote: Counting objects: 995, done.
remote: Compressing objects: 100% (885/885), done.
remote: Total 995 (delta 243), reused 488 (delta 88), pack-reused 0
Receiving objects: 100% (995/995), 908.3

...The following is omitted...

$ brew upgrade pyenv
==> Upgrading 1 outdated package, with result:
pyenv 20151222
==> Upgrading pyenv
==> Installing dependencies

...The following is omitted...

Homebrew update doesn't work

An error that occurred when trying to update Homebrew.

$ brew update
Error: The /usr/local directory is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. For example, upgrading
to OS X El Capitan has been known to do this. Some versions of the
"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations
are known to do this as well.

You should probably change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami):admin /usr/local

The error was not resolved even if I followed the message that appeared after typing the command, so I resolved it by referring to this. * 1

$ sudo chown -R $(whoami):admin /usr/local
Password:

$ cd $(brew --prefix) && git fetch origin && git reset --hard origin/master
remote: Counting objects: 18655, done.
remote: Total 18655 (delta 7759), reused 7759 (delta 7759), pack-reused 10896
Receiving objects: 100% (18655/18655), 4.99 MiB

...The following is omitted...

local $ cd ~            #Move to home directory
$ brew update
...The following is omitted...

After the brew update, you will be prompted to regain permissions, so Execute the command according to the message

$ sudo chown root:wheel /usr/local
Password:

pyenv install 3.X.X causes BUILD FAILED

An error that occurred when trying to install Python3 using pyenv. An error that occurs without the Xcode command line tool. It seems to occur in OSX El Capitan. * 2

test_py326 $ pwd            #The directory you were working in
/Users/XXX/work/test_py326

test_py326 $ pyenv install 3.2.6
Installing Python-3.2.6...
patching file ./Modules/readline.c
Hunk #1 succeeded at 225 (offset -6 lines).
Hunk #2 succeeded at 760 (offset -13 lines).
Hunk #3 succeeded at 813 (offset -13 lines).
Hunk #4 succeeded at 871 (offset -13 lines).
Hunk #5 succeeded at 919 with fuzz 2 (offset -24 lines).
patching file ./Lib/ssl.py
patching file ./Modules/_ssl.c
WARNING: The Python sqlite3 extension was not compiled. Missing the SQLite3 lib?
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 (OS X 10.11.6 using python-build 20151028)

Inspect or clean up the working tree at /var/folders/z_/2dz9yyhd5_x_rczbsxcs_cdw0000gn/T/python-build.20161005151953.36759
Results logged to /var/folders/z_/2dz9yyhd5_x_rczbsxcs_cdw0000gn/T/python-build.20161005151953.36759.log

Execute the following command and follow the pop-up to install the Xcode command line tool.

$ xcode-select --install

If you cannot install Python3 after executing the above, update pyenv again and then execute pyenv install.

$ brew upgrade pyenv
...The following is omitted...

$ cd work/test_py326
test_py326 $ pyenv install 3.2.6
...The following is omitted...

I don't know why ٩ (ᐛ) و

reference

  1. brew update error #49879
  2. [Python 3 system compatible] Easy to install and try with pyenv on Mac (OS X EL Capitan)
  3. How to deal with python installation error in pyenv (BUILD FAILED)

Recommended Posts

I can't install python3 with pyenv-vertualenv
I can't install mysql-connector-python with anaconda
I can't install scikit-learn in Python
I can't install the package with pip.
Why can't I install matplotlib in python! !!
I can't install Anaconda!
Install Voluptuous with Python 2.5
Install python with pyenv
I can't install Dask with pip on Ubuntu
I wanted to install Python 3.4.3 with Homebrew + pyenv
I tried fp-growth with python
I tried scraping with Python
Install Python environment with Anaconda
I made blackjack with python!
Install external libraries with Python
I can't search with # google-map. ..
I tried gRPC with Python
I tried scraping with python
I made blackjack with Python.
I made wordcloud with Python.
TensorFlow 2.2 can't be installed with Python 3.8!
Install Python 2.7.9 and Python 3.4.x with pip.
install python
HomeBrew can't install Python (at Mavericks)
Install Python from source with Ansible
I tried web scraping with python.
I can't remember Python regular expressions
I can't download images with Google_images_download
I made a fortune with Python.
I sent an SMS with Python
Install the Python plugin with Netbeans 8.0.2
Unable to install Python with pyenv
I liked the tweet with python. ..
I played with PyQt5 and Python3
I can't use Japanese with pyperclip
I want to debug with Python
I tried running prolog with python 3.8.2.
I made a daemon with Python
I tried SMTP communication with Python
Install python with mac vs code
[Python Windows] pip install with Python version
What to do if you can't install pyaudio with pip #Python
Install Python as a Framework with pyenv
I tried scraping Yahoo News with Python
I made a character counter with Python
I drew a heatmap with seaborn [Python]
I wanted to solve ABC160 with Python
I tried sending an email with python.
I want to pip install with PythonAnywhere
I tried non-photorealistic rendering with Python + opencv
I can't debug python scripts in Eclipse
I want to analyze logs with Python
scipy stumbles with pip install on python 2.7.8
I want to play with aws with python
I tried a functional language with Python
I tried recursion with Python ② (Fibonacci sequence)
I installed and used Numba with Python3.5
What I did with a Python array
I can't deploy with google app engine
I made a Hex map with Python
I made a roguelike game with Python