简介:

记录 CentOS 6.x Python 环境的安装步骤。

一、安装依赖包

shell > yum -y install epel-release
shell > yum -y install gcc gcc-c++ wget readline-devel zlib-devel openssl-devel sqlite-devel shell > python -V
Python 2.6.

一、安装 Python 2.7

shell > cd /usr/local/src; wget -c https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
shell > tar zxf Python-2.7..tgz
sehll > cd Python-2.7.
shell > ./configure && make && make install shell > python2 -V
Python 2.7.

二、安装 Python 3.5

shell > cd /usr/local/src; wget -c https://www.python.org/ftp/python/3.5.4/Python-3.5.4.tgz
shell > tar zxf Python-3.5..tgz
shell > cd Python-3.5.
shell > ./configure && make && make install shell > python3 -V
Python 3.5.

三、安装 Virtualenv

shell > pip3 install virtualenv

四、创建不同的 Python 环境

1、Python 2.x

shell > virtualenv --no-site-packages -p python2 py2.x
shell > source py2.x/bin/activate (py2.x) shell > python -V
Python 2.7. (py2.x) shell > pip install ipython (py2.x) shell > ipython
Python 2.7. (default, Aug , ::)
Type "copyright", "credits" or "license" for more information. IPython 5.4. -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details. In []: (py2.x) shell > deactivate
# 创建了一个 python2 的虚拟环境 名称为 py2.x,之后激活这个虚拟环境
# 可以看到默认的 python 版本已经不是原来的 2.6.6
# 使用 pip 安装 ipython 软件包
# ipython 调用的 python 版本也是 2.7.13
# 退出虚拟环境

2、Python 3.x

shell > virtualenv --no-site-packages -p python3 py3.x
shell > source py3.x/bin/activate (py3.x) shell > python -V
Python 3.5. (py3.x) shell > pip install ipython (py3.x) shell > ipython
Python 3.5. (default, Aug , ::)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.1. -- An enhanced Interactive Python. Type '?' for help. In []: (py3.x) shell > deactivate

# End

Python Env的更多相关文章

  1. Error: Can't find Python executable, you can set the PYTHON env variable.

    该错误解决方案. NodeJS安装Npm包时出现错误: npm WARN prefer global node-gyp@3.4.0 should be installed with -g > s ...

  2. 56.ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

    Node.js 在安装模块的时候报错,缺少python环境. ERR! configure error gyp ERR! stack Error: Can't find Python executab ...

  3. 解决Error: Can't find Python executable "python", you can set the PYTHON env variable

    在执行 yarn start时遇到问题, 最后一行提示 Run `npm rebuild node-sass` to download the binding for your current env ...

  4. VsCode/Pycharm配合python env 使用

    前言 用惯了vscode,这几天试了一下pycharm,还是回来了. pycharm一个好处就是python env 环境支持的比较好, vscode虽然也支持但是要改一些东西 env的使用查看我的上 ...

  5. 成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.

    今天跑公司新项目的时候.运行前端vue.报了一个关于python的错误.就离谱 1.问题报错全部代码 actual version of core-js. npm ERR! code 1 npm ER ...

  6. beat your own python env

    1,进入根目录,修改.bashrc,增加一个PATH目录 例如:alias cjtf='export PATH=/home/www/xxx/python_env:$PATH' 如果个人的机器的就不用a ...

  7. Python env使用(virtualenv)

    前言 Python 的 virualenv 模块闻名已久,乘着有点时间,学习一下 变更记录 # 19.3.26  创建文章 # 19.3.27  完善文章 正文 安装 pip install virt ...

  8. ERROR: CAN'T FIND PYTHON EXECUTABLE "PYTHON", YOU CAN SET THE PYTHON ENV VARIABLE.解决办法

    错误原因:Node.js 在安装模块的时候报错,缺少python环境. 解决办法: 第一种方式: 安装Python及环境变量配置 一定要安装python2.7的版本 环境变量安装可以参考:http:/ ...

  9. python 01

    注意Python 是大小写敏感的,即print 与Print 不一样 推荐编辑器 vim & sublime 如何运行 #!/usr/bin/python#Filename: hellowor ...

随机推荐

  1. netty SimpleChannelInboundHandler<Message>和ChannelInboundHandlerApter

    一个兄弟的测试体验:https://blog.csdn.net/linuu/article/details/51307060 比较官方:https://www.imooc.com/article/28 ...

  2. tyvj1659中中救援队

    题目:http://www.joyoi.cn/problem/tyvj-1659 发现每条边要走两次,每个点要走它连接的边数次. 所以把边的权值赋成 本身的值+两个端点的点权,求最小生成树即可. !边 ...

  3. Tomcat 去除项目名称

    再tomcat的conf下server.xml  里, 再<host>...</host>的标签之间添加 <Context path="" docBa ...

  4. [转]StarWind模拟iSCSI设备

    StarWind模拟iSCSI设备 url: http://jimshu.blog.51cto.com/3171847/590412/  标签:职场 iSCSI 休闲 StarWind 原创作品,允许 ...

  5. ORACLE删除某用户下所有对象

    ORACLE删除某用户下所有对象 2013-10-26 15:50 4996人阅读 评论(1) 收藏 举报   --.sql脚本 --唯一注意的是下面的D:\dropobj.sql 为操作的.sql; ...

  6. orace学习操作(4)

    Orace游标: 一.游标简介: 使用游标,我们可以对具体操作数据,比如查询的结果,对行,列数据进行更加细致的处理.以及对其他DML操作进行判断等操作: 二.显示游标: 1.静态的指定变量类型: SQ ...

  7. 子网掩码 解释 ---判断各部机器ip 是不是同一个网段

    主要作用是地址判断 编辑 子网掩码是用来判断任意两台计算机的IP地址是否属于同一子网络的根据. 最为简单的理解就是两台计算机各自的  IP地址与子网掩码进行AND运算后,如果得出的结果是相同的,  则 ...

  8. 页面引用jquery中文变乱码的问题

    <script type="text/javascript" src="Js/JavaScript.js"></script>   方法 ...

  9. 1027 Colors in Mars (20 分)

    1027 Colors in Mars (20 分) People in Mars represent the colors in their computers in a similar way a ...

  10. phpexcel导入数据出现PHPExcel_RichText Object解决办法

    在导入excel的时候会出现异常情况,有的问题出现PHPExcel_RichText object,错误代码如下 PHPExcel_RichText Object ( [_richTextElemen ...