*** 1. 终端打开.bash_profile文件 ***open ~/.bash_profile *** 2. .bash_profile文件内容 ***# Setting PATH for Python 3.5# The original version is saved in .bash_profile.pysavePATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}"export PATH **
本文的实现目标是在mac上安装一个python3.5.0的版本,跟当前系统自带的python2.7.10共存. 查看当前版本号 python -V 2.7.10 安装配置Python版本管理器pyenv 1. 安装pyenv brew install pyenv 安装过程中,遇到一个一个问题Error: parent directory is world writable but not sticky 2. 根据提示需要添加变量 if which pyenv > /dev/null; then
1. 终端打开.bash_profile文件 终端输入:open ~/.bash_profile 2. 打开.bash_profile文件后在内容最后添加 alias python="/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6" alias python2="/usr/bin/python2.7" alias python="输入python3的路径 你自己本机路径可