zoukankan      html  css  js  c++  java
  • 安装pyenv

    1、安装依赖
    yum -y install gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel git

    2、安装pyenv

    git clone https://github.com/yyuu/pyenv.git /opt/app/.pyenv/
    # 配置环境变量
    echo 'export PYENV_ROOT="/opt/app/.pyenv"' >> ~/.bash_profile
    echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
    if command -v pyenv 1>/dev/null 2>&1; then
            eval "$(pyenv init --path)"
    fi
    source ~/.bash_profile
    # 查看pyenv版本
    pyenv -v

    3、使用pyenv

    pyenv help
    Usage: pyenv <command> [<args>]
    Some useful pyenv commands are:
       commands    List all available pyenv commands
       exec        Run an executable with the selected Python version
       global      Set or show the global Python version(s)
       help        Display help for a command
       hooks       List hook scripts for a given pyenv command
       init        Configure the shell environment for pyenv
       install     Install a Python version using python-build
       local       Set or show the local application-specific Python version(s)
       prefix      Display prefix for a Python version
       rehash      Rehash pyenv shims (run this after installing executables)
       root        Display the root directory where versions and shims are kept
       shell       Set or show the shell-specific Python version
       shims       List existing pyenv shims
       uninstall   Uninstall a specific Python version
       version     Show the current Python version(s) and its origin
       --version   Display the version of pyenv
       version-file   Detect the file that sets the current pyenv version
       version-name   Show the current Python version
       version-origin   Explain how the current Python version is set
       versions    List all Python versions available to pyenv
       whence      List all Python versions that contain the given executable
       which       Display the full path to an executable

    4、使用pyen安装python

    # 使用 pyenv install --list 查看可以安装的python版本,安装3.6.4版本
    pyenv install 3.6.4
    # 安装完成后目录所在
    /opt/app/.pyenv/versions
    # 查看可使用的版本,前面带*表示当前使用的版本
    pyenv versions
    # 查看当前使用的版本
    pyenv version

    5、配置及管理python版本

    # pyenv管理python版本的三个基础命令
    pyenv global <version>
    pyenv shelll <version>
    pyenv local <version>
    # 使用pyenv global <version>配置当前用户的系统使用的python版本
    pyenv global 3.6.4
    python -V

  • 相关阅读:
    nginx设置缓存策略
    http缓存原理理解
    promise教程
    vue项目发布到github演示
    vue路由嵌套子路由不渲染
    hihocoder 1403 1407 1415 后缀数组*3 最长公共子串/最长不重叠重复出现的子串/最长k次重复子串
    hdu 4691 后缀数组+rmq 求子串lcp
    hdu1506+ luogu 1440 单调栈/单调队列裸题
    codeforces 873F 后缀数组+单调栈(fastio)
    HihoCoder
  • 原文地址:https://www.cnblogs.com/sxFu/p/14827513.html
Copyright © 2011-2022 走看看