首先到Github上下载Pyenv相应的一键安装脚本,

  安装完毕,设置环境变量,设置环境变量,可以添加到个人家目录的.bashrc或.bash_profile及系统的全局的/etc/profile,

  # Load pyenv automatically by adding

  # the following to ~/.bash_profile:

  export PATH="/home/lavenliu/.pyenv/bin:$PATH"

  eval "$(pyenv init -)"

  eval "$(pyenv virtualenv-init -)"

  设置完毕之后,可以在命令行进行验证,

  [lavenliu@VM_113_230_centos ~]$ . ~/.bash_profile

  [lavenliu@VM_113_230_centos ~]$ pyenv

  pyenv 20160726

  Usage: pyenv []

  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 ' for information on a specific command.

  For full documentation, see: https://github.com/yyuu/pyenv#readme

  以上都没有问题。比如,安装一个3.5.2的版本Python,

  pyenv install 3.5.2

  如果下载速度慢的话,可以事先下载之,放到~/.pyenv/cache目录即可。修改~/.pyenv/plugins/python-build/share/python-build/3.5.2文件,

  cat ~/.pyenv/plugins/python-build/share/python-build/3.5.2

  #require_gcc

  install_package "openssl-1.0.2g" "https://www.openssl.org/source/openssl-1.0.2g.tar.gz#b784b1b3907ce39abf4098702dade6365522a253ad1552e267a9a0e89594aa33" mac_openssl --if has_broken_mac_openssl

  install_package "readline-6.3" "http://ftpmirror.gnu.org/readline/readline-6.3.tar.gz#56ba6071b9462f980c5a72ab0023893b65ba6debb4eeb475d7a563dc65cafd43" standard --if has_broken_mac_readline

  if has_tar_xz_support; then

  install_package "Python-3.5.2" "~/.pyenv/cache/Python-3.5.2.tar.gz" ldflags_dirs standard verify_py35 ensurepip

  else

  install_package "Python-3.5.2" "~/.pyenv/cache/Python-3.5.2.tar.gz" ldflags_dirs standard verify_py35 ensurepip

  fi无锡人流多少钱 http://wapyyk.39.net/wx/zonghe/fc96e.html

  由于没有~/.pyenv/cache目录,进行手工创建,

  $ mkdir ~/.pyenv/cache

  如果使用手工安装,则需要安装一些依赖,

  # yum install -y gcc make patch gdbm-devel openssl-devel sqlite-devel zlib-devel bzip2-devel readline-devel

  需要事先准备好Python-3.5.2.tar.gz的安装包,放到~/.pyenv/cache目录下。然后,在命令行直接使用pyenv install 3.5.2即可,

  $ pyenv install 3.5.2

  安装完毕,使用version命令进行查看,

  pyenv version

  3.5.2 (set by /home/lavenliu/.python-version)

  至此,就安装完毕了。

Python开发环境之pyenv环境搭建的更多相关文章

  1. Python开发程序:生产环境下实时统计网站访问日志信息

    日志实时分析系统 生产环境下有需求:要每搁五分钟统计下这段时间内的网站访问量.UV.独立IP等信息,用直观的数据表格表现出来 环境描述: 网站为Nginx服务,系统每日凌晨会对日志进行分割,拷贝到其他 ...

  2. Python开发虚拟环境使用virtualenvwrapper的搭建及pycharm链接步骤

    virtualenv 是一个创建隔绝的Python环境的工具.virtualenv创建一个包含所有必要的可执行文件的文件夹,用来使用Python工程所需的包.创建的环境是独立的,互不干扰,无需sudo ...

  3. Python开发【Tornado】:搭建文件下载服务、音频文件播放

    Tornado 如何做文件下载 要求:浏览器输入url地址,直接弹窗提示下载 Tornado服务端,搭建文件下载服务 #!/usr/bin/env python # -*- coding:utf-8 ...

  4. 『无为则无心』Python基础 — 3、搭建Python开发环境

    目录 1.Python开发环境介绍 2.Python解释器的分类 3.下载Python解释器 4.安装Python解释器 5.Python解释器验证 1.Python开发环境介绍 所谓"工欲 ...

  5. 搭建Python开发环境(Mac)

    准备 Python官网: https://www.python.org/ Python官方文档: https://docs.python.org/ 环境搭建 简介 pipenv是Python官方推荐的 ...

  6. python开发环境搭建

    虽然网上有很多python开发环境搭建的文章,不过重复造轮子还是要的,记录一下过程,方便自己以后配置,也方便正在学习中的同事配置他们的环境. 1.准备好安装包 1)上python官网下载python运 ...

  7. Eclipse中Python开发环境搭建

    Eclipse中Python开发环境搭建  目 录  1.背景介绍 2.Python安装 3.插件PyDev安装 4.测试Demo演示 一.背景介绍 Eclipse是一款基于Java的可扩展开发平台. ...

  8. Python开发:环境搭建(python3、PyCharm)

    Python开发:环境搭建(python3.PyCharm) python3版本安装 PyCharm使用(完全图解(最新经典))

  9. ubuntu上用eclipse搭建java、python开发环境

    上一篇文章讲到如何在windwos上用eclipse搭建java.python开发环境,这一讲将关注如何在ubuntu上实现搭建,本人使用虚拟机安装的ubuntu系统,系统版本为:14.04 lts ...

随机推荐

  1. python 中site-packages 和 dist-packages的区别

    dist-packages is a Debian-specific convention that is also present in its derivatives, like Ubuntu. ...

  2. HDU - 6066 RXD's date

    Bryce1010模板 http://acm.hdu.edu.cn/showproblem.php?pid=6066 #include <iostream> using namespace ...

  3. Codeforces Round #395 (Div. 2) A

    Description Comrade Dujikov is busy choosing artists for Timofey's birthday and is recieving calls f ...

  4. bzoj2154||洛谷P1829 Crash的数字表格&&JZPTAB && bzoj3309 DZY Loves Math

    bzoj2154||洛谷P1829 https://www.lydsy.com/JudgeOnline/problem.php?id=2154 https://www.luogu.org/proble ...

  5. BFS 2015百度之星初赛2 HDOJ 5254 棋盘占领

    题目传送门 /* BFS:先把1的入队,每个1和它相邻的组合后看看能不能使0变1,若有则添加入队,change函数返回改变了多少个0 注意:结果还要加上原来占领的 */ #include <cs ...

  6. tsconfig.json No inputs were found in config file

    Build:No inputs were found in config file '/tsconfig.json'. Specified 'include' paths were '["* ...

  7. 关于spring mvc 和struts2的描述与对比

    链接:https://www.nowcoder.com/questionTerminal/cf803beb7e3346caa636e4eaa3a8c2e9来源:牛客网 ---------------- ...

  8. springboot之读取配置文件

    1.propertie配置读取数据 /** * 通过value取配置文件中的数据 */ @Component @PropertySource(value = {"config/db-conf ...

  9. DOM编程练习(慕课网题目)

    编程练习 制作一个表格,显示班级的学生信息. 要求: 1. 鼠标移到不同行上时背景色改为色值为 #f2f2f2,移开鼠标时则恢复为原背景色 #fff 2. 点击添加按钮,能动态在最后添加一行 3. 点 ...

  10. iOS 自己手动添加编译警告

    文/青花瓷的平方(简书作者)原文链接:http://www.jianshu.com/p/b2e30cad2a0d著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”. 缘由 上一次生产环境我们 ...