Python Env
简介:
记录 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的更多相关文章
- 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 ...
- 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 ...
- 解决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 ...
- VsCode/Pycharm配合python env 使用
前言 用惯了vscode,这几天试了一下pycharm,还是回来了. pycharm一个好处就是python env 环境支持的比较好, vscode虽然也支持但是要改一些东西 env的使用查看我的上 ...
- 成功解决: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 ...
- beat your own python env
1,进入根目录,修改.bashrc,增加一个PATH目录 例如:alias cjtf='export PATH=/home/www/xxx/python_env:$PATH' 如果个人的机器的就不用a ...
- Python env使用(virtualenv)
前言 Python 的 virualenv 模块闻名已久,乘着有点时间,学习一下 变更记录 # 19.3.26 创建文章 # 19.3.27 完善文章 正文 安装 pip install virt ...
- ERROR: CAN'T FIND PYTHON EXECUTABLE "PYTHON", YOU CAN SET THE PYTHON ENV VARIABLE.解决办法
错误原因:Node.js 在安装模块的时候报错,缺少python环境. 解决办法: 第一种方式: 安装Python及环境变量配置 一定要安装python2.7的版本 环境变量安装可以参考:http:/ ...
- python 01
注意Python 是大小写敏感的,即print 与Print 不一样 推荐编辑器 vim & sublime 如何运行 #!/usr/bin/python#Filename: hellowor ...
随机推荐
- 上产使用MQ的三点注意
安全性考量:在正式环境中使用消息队列中间件服务一定要做相关的安全性设置.包括启用消息队列服务的用户名和密码.启用消息队列服务自带的SSL加密设置.如果您使用的消息队列服务不自带SSL加密,则一定要自己 ...
- TNS-12535 TNS-00505的处理方法
原文地址:TNS-12535 TNS-00505的处理方法 作者:wzq609 硬件说明: 操作系统版本:ORACLE LINUX 6.3 64位 数据库版本:11.2.0.3 64位 问题说明 ...
- mySQL教程 第1章 数据库设计
E-R设计 很多同学在学SQL语句时,觉得非常困难,那是因为你在学一个你根本不了解的数据库,数据库中的表不是你设计的,表与表之间的关系你不明白.因此在学SQL语句之前,先介绍一下数据库设计. 下面举例 ...
- DHCP服务器备份、还原、迁移
备份DHCP服务器 $today = get-date $todayu = get-date -format 'yyyyMMdd' #备份DHCP数据库,用于还原到本地 Backup-DhcpServ ...
- 在Windows下安装Linux
使用工具:EasyBCD,该工具支持xp/win7. 安装EasyBCD后新建一个grub启动项: 将Linux ISO文件复制到一个干净的fat分区: 将ISO中的isolinux和images目录 ...
- VBA注释临时
Sub shishi() '按ABCDE为多选题定义答案; 'A.沙利度胺 B.异烟肼 C.利福平 'd.氯法齐明 E.氨苯砜 '46.各型麻风病的首选药物为(D) 'A.沙利度胺 B.异烟肼 C.利 ...
- python selenium-9 grid模式
grid是进行分布式测试的工具,由一个hub主节点和若干个node代理节点组成 1.下载Selenium Standalone Server 下载地址:https://www.seleniumhq.o ...
- python 正则表达式的处理
1.基本用法 #!/usr/bin/env python # coding=utf-8 import re # example 1 text ="fjsk test\t fjskd bar\ ...
- mongodb 如何区分大小写
mongodb是区分大小写的,在做mongodb数据库操作是经常使用toUpperCase()等方法将value转换为大写存到数据库中 e.g. 在做数据库模糊查询时语句如下 db.COLLECTIO ...
- java自定义事件机制分析
import java.util.ArrayList; import java.util.EventListener; import java.util.EventObject; import jav ...