一、Git克隆方式

  1.安装git

    yum -y install git

  2.克隆pyenv到本地

    git clone https://github.com/pyenv/pyenv.git ~/.pyenv

  3.配置环境变量

1 [root@localhost ~]# echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
2 [root@localhost ~]# echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
3 [root@localhost ~]# source .bash_profile 
4 [root@localhost ~]# pyenv --version
5 pyenv 1.2.9-32-g64c0828

  4.pyenv初始化到当前用户shell

eval "($pyenv init -)"

  5.重启shell并开始使用pyenv

  

[root@localhost ~]# exec "$SHELL"
[root@localhost ~]# pyenv -h
Usage: pyenv <command> [<args>]

Some useful pyenv commands are:
   commands    List all available pyenv commands
   local       Set or show the local application-specific Python version
   global      Set or show the global Python version
   shell       Set or show the shell-specific Python version
   install     Install a Python version using python-build
   uninstall   Uninstall a specific Python version
   rehash      Rehash pyenv shims (run this after installing executables)
   version     Show the current Python version and its origin
   versions    List all Python versions available to pyenv
   which       Display the full path to an executable
   whence      List all Python versions that contain the given executable

   6.安装python之前相关依赖包的安装

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y

 

转载于:https://www.cnblogs.com/yunxiaobai8/p/10613750.html

Logo

开放原子开发者工作坊旨在鼓励更多人参与开源活动,与志同道合的开发者们相互交流开发经验、分享开发心得、获取前沿技术趋势。工作坊有多种形式的开发者活动,如meetup、训练营等,主打技术交流,干货满满,真诚地邀请各位开发者共同参与!

更多推荐