Take a little note, please.
Because the full turn to Python 3.4 as the main development version, but the hands of Mac OS X and server are used in Python 2.7, so need to installpyenv.
Follow the instructions on their GitHub page to use thehomebrewinstallation
brew update
brew install pyenv
When the installation is complete, it appears:
[[email protected]/Users/apple]$ brew install pyenv
==> Installing pyenv
==> Downloading https://homebrew.bintray.com/bottles/pyenv-20150601.yosemite.bot
Already downloaded: /Library/Caches/Homebrew/pyenv-20150601.yosemite.bottle.tar.gz
==> Pouring pyenv-20150601.yosemite.bottle.tar.gz
==> Caveats To enable shims and autocompletion add to your profile: if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi To use Homebrew‘s directories rather than ~/.pyenv add to your profile:
export PYENV_ROOT=/usr/local/var/pyenv
==> Summary
/usr/local/Cellar/pyenv/20150601: 349 files, 2.8M
Then I was very obedient to the two lines of script added~/.bash_profile, andsourcea bit.
The next usepyenv {install|local}of the installation is to use a variety of versions without mentioning, but not as I intended to work.
[apple@/Users/apple/qc-coding/wa]$ pyenv version 3.4.3 (set by /Users/apple/qc-coding/wa/.python-version)
[apple@/Users/apple/qc-coding/wa]$ python --version
Python 2.7.9 [apple@/Users/apple/qc-coding/wa]$ which python /usr/local/bin/python [apple@/Users/apple/qc-coding/wa]$ which pyenv
/usr/local/bin/pyenv
[apple@/Users/apple/qc-coding/wa]$ pyenv versions system * 3.4.3 (set by /Users/apple/qc-coding/wa/.python-version)
[apple@/Users/apple/qc-coding/wa]$ python --version
Python 2.7.9
In the meantime, doubts, such as~/.bash_profilethe suspicion of not being executed, or even the fact that the Mac OS X comes with abashlower version, would be the cause, almost installing a different oneshell.
Later thought that all sorts of things are pointing to "can not find through thepyenvinstallation ofPython" This thing, and then read its installation instructions, did not mention to addexport PYENV_ROOT=/usr/local/var/pyenv, began to doubt that they added this line. Then removed, re-opened a terminal process, test, OK.
[[email protected]/Users/apple/qc-coding/wa]$ pyenv local 3.4.3 [[email protected]/Users/apple/qc-coding/wa]$ python
Python 3.4.3 (default, Jun 3 2015, 11:57:01)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information.
>>>
Sure enough, you can't be too obedient ... Howeverpyenv, this installation prompt is also enough deceptive.
Install a small pit of pyenv in Mac OS X 10.10