Ubuntu安装pyenv实现python多版本控制

git clone git://github.com/yyuu/pyenv.git ~/.pyenv
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(pyenv init -)"' >> ~/.bashrc
exec $SHELL -l

查看可安装的版本

pyenv install --list

比如安装python2.7.14和python3.6.3版本

pyenv install 2.7.14 -v
pyenv install 3.6.3 -v

设置其为全局python

pyenv global 2.7.14 3.6.3

查看是否安装成功

ltq@lab:~$ python
Python 2.7.14 (default, Nov 25 2017, 23:00:16)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()
ltq@lab:~$ python3
Python 3.6.3 (default, Nov 27 2017, 22:54:07)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exit()

另外,每当你增删了 Python 版本或带有可执行文件的包(如 pip)以后,都应该执行一次本

pyenv rehash

更多命令参考pyenv-github,或者

ltq@lab:~$ 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 See `pyenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/pyenv/pyenv#readme

https://github.com/pyenv/pyenv

Ubuntu安装pyenv实现多版本控制的更多相关文章

  1. Ubuntu安装pyenv实现python多版本控制

    Ubuntu安装pyenv实现python多版本控制 git clone git://github.com/yyuu/pyenv.git ~/.pyenv echo 'export PYENV_ROO ...

  2. ubuntu安装pyenv

    安装依赖包 bash {.line-numbers} sudo apt-get update sudo apt-get install build-essential python-dev pytho ...

  3. Ubuntu下安装Pyenv不成功,求指教

    虚拟机:VMware12.0 操作系统:Ubuntu16.04 LTS (新安装系统) 已经按照网上的步骤: 1.安装git: $sudo apt-get install git 2.安装依赖包: $ ...

  4. 在Ubuntu上安装pyenv

    因为找到一个域名枚举的脚本使用Python3编写的,而我一直习惯的是使用Python2.7,在自己的Windows7上再安装个Python怕混了,于是想着在VPS上装个Python的版本管理工具,也方 ...

  5. Ubuntu 18.04安装 pyenv、pyenv-virtualenv、virtualenv、Numpy、SciPy、Pillow、Matplotlib

    1.目前Python版本管理工具有很多,pyenv是比较好用的一款,安装如下: 输入: git clone https://github.com/pyenv/pyenv.git ~/.pyenv ec ...

  6. Ubuntu系统安装Pyenv

    安装Pyenv curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | ...

  7. Mac下安装pyenv

    mac 用virtualenv安装py3.6的虚拟环境报错(virtualenv -p /usr/bin/python3 env36), 解决的话需要安装zlib包, 然后去掉configure配置里 ...

  8. Ubuntu安装spyder并添加快捷方式

    Ubuntu安装spyder并添加快捷方式 之前通过 sudo apt install spyder sudo apt install spyder3 安装spyder,但是这样有个坏处,编译器只能用 ...

  9. [PY3]——环境配置(1)——pyenv | pip | ipython | jupyter(含安装pyenv环境shell脚本)

    1.关于pyenv (1)pyenv是一个开源的.shell脚本编写的工具:Simple Python version management (2)为什么使用pyenv:当多个项目同时在开发与维护时, ...

随机推荐

  1. win8.1 安装

    下载了Windows8.1企业版的iso文件,文件名称:cn_windows_8_1_enterprise_x86_dvd_2791409.iso 下载地址: http://msdn.itellyou ...

  2. hdu 1018 共同交流~

    Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

  3. C# To C++ Converter Cracked ( 破解版 )

    C# To C++ Converter v17.10.2 Cracked By X-Cracker 简介 C# To C++ Converter是一款将C#代码或者项目转换为C++的工具 免费版本一次 ...

  4. mybatis 的mapper配置文件sql语句中, 有时用到 大于, 小于等等

    一, 用<![CDATA[   ]]>标识,例如: <if test="create_timeStart != null and create_timeStart != ' ...

  5. JDBC的基本用法

    一.编程步骤 1.加载驱动 Class forName("com.mysql.jdbc.Driver"):mysql驱动 Class forName("oralce.jd ...

  6. SpringMVC的流程分析(一)—— 整体流程概括

    SpringMVC的整体概括 之前也写过springmvc的流程分析,只是当时理解的还不透彻所以那篇文章就放弃了,现在比之前好了些,想着写下来分享下,也能增强记忆,也希望可以帮助到人,如果文章中有什么 ...

  7. How to change your password of your mysql account in WampServer

    #1. use phpmyadmin to login mysql and click the account menu, and then click "Change the passwo ...

  8. 开源纯C#工控网关+组态软件(五)从网关到人机界面

    一.   引子 之前都在讲网关,不少网友关注如何实现界面.想了解下位机变量变化,是怎样一步步触发人机界面动画的. 这个步步触发,实质上是变量组(Group)的批量数据变化(DataChange)事件, ...

  9. poj2635The Embarrassed Cryptographer(同余膜定理)

    The Embarrassed Cryptographer Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 15069   A ...

  10. 逆向课程第二讲,寻找main入口点

    逆向课程第二讲,寻找main入口点 一丶识别各个程序的入口点 入门知识,识别各个应用程序的入口点 (举例识别VC 编译器生成,以及VS编译生成的Debug版本以及Release版本) 1.识别VC6. ...