ubuntu 安装 pythonenv
2016-06-02 11:29
483 查看
This will get you going with the latest version of pyenv and make it easy to fork and contribute any changes back upstream.
Check out pyenv where you want it installed. A good place to choose is
Define environment variable
Zsh note: Modify your
Add
Zsh note: Modify your
General warning: There are some systems where the
Restart your shell so the path changes take effect. You can now begin using pyenv.
Install Python versions into
Check out pyenv where you want it installed. A good place to choose is
$HOME/.pyenv(but you can install it somewhere else).
$ git clone https://github.com/yyuu/pyenv.git ~/.pyenv
Define environment variable
PYENV_ROOTto point to the path where pyenv repo is cloned and add
$PYENV_ROOT/binto your
$PATHfor access to the
pyenvcommand-line utility.
$ echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile $ echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
Zsh note: Modify your
~/.zshenvfile instead of
~/.bash_profile. Ubuntu note: Modify your
~/.bashrcfile instead of
~/.bash_profile.
Add
pyenv initto your shell to enable shims and autocompletion. Please make sure
eval "$(pyenv init -)"is placed toward the end of the shell configuration file since it manipulates
PATHduring the initialization.
$ echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
Zsh note: Modify your
~/.zshenvfile instead of
~/.bash_profile. Ubuntu note: Modify your
~/.bashrcfile instead of
~/.bash_profile.
General warning: There are some systems where the
BASH_ENVvariable is configured to point to
.bashrc. On such systems you should almost certainly put the abovementioned line
eval "$(pyenv init -)into
.bash_profile, andnot into
.bashrc. Otherwise you may observe strange behaviour, such as
pyenvgetting into an infinite loop. See #264for details.
Restart your shell so the path changes take effect. You can now begin using pyenv.
$ exec $SHELL
Install Python versions into
$PYENV_ROOT/versions. For example, to download and install Python 2.7.8, run:
$ pyenv install 2.7.8
相关文章推荐
- netCDF4-python的安装
- Windows下如何获取与手机设备有关的进程信息(Python版)
- Python2学习笔记(4)
- python常见环境安装
- leetcode 77. Combinations-排列|递归|非递归|Java|Python
- Python——Windows下安装gevent依赖包
- python操作mysql数据库
- Python 递归函数
- 常用的调试器——概述篇
- Python 标准库 —— cgi/html
- python基础回顾
- (selenium 小知识点)解决使用Webdrive打开Firefox不含有插件的问题(python)
- 转帖文章(感谢作者)-pyenv安 3ff0 装与使用-多版本python共存解决方法
- Python 进阶 —— 重访 tuple
- leetcode 48. Rotate Image-矩阵旋转
- Python复杂对象转JSON
- 17个新手常见Python运行时错误
- python random模块
- 2. python入门杂记
- python类1