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.
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...
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:
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 ٩ (ᐛ) و
Recommended Posts