1.安装完pyenv时,并没有出现问题。但在安装python3.6.1时报错:
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
这是因为缺少Pyenv依赖的包。查看官方的wiki(https://github.com/pyenv/pyenv/wiki/Common-build-problems),发现是需要先安装依赖包
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev
2.在安装依赖包的过程中发现几个包不能安装,因为apt-get版本太低的原因,apt-get update,再次安装,成功。
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
3.pyenv global 3.6.1 后,发现python后打开的还是系统默认的2.7版本。
因为没有安装新的python版本后没有pyenv rehash 。