Install a small pit of pyenv in Mac OS X 10.10

Source: Internet
Author: User



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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.