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 ...
随机推荐
- vue-cli 项目构建性能分析工具
修改package.json { ... "scripts": { ... //新增 "analyz": "NODE_ENV=production n ...
- linux下编译GD(freetype+libjpeg+libpng+gd-devel)
linux下编译GD(freetype+libjpeg+libpng+gd-devel) 1.检查freetype是否安装rpm -qa | grep freetype没有的话编译freetype 这 ...
- java 环境变量与安装目录
JDK安装完成后有如下文件夹 bin:存放JDK的各种工具命令,如javac.java等命令. jre:运行java程序所必须的JRE环境 lib:JDK工具命令的实际执行程序,如tools.jar中 ...
- 【appium】根据accessibility_id定位元素
如何获得AccessibilityId 可以通过UIAutomatorViewer或者Appium Inspector获得.Accessibility ID在Android上面就等同于contentD ...
- python之BeautifulSoup4的例子
仅作演示用 from bs4 import BeautifulSoup import urllib.request webfile = urllib.request.urlopen('http://w ...
- react组件的创建
最近项目接触react和rn,之前会一些vue和小程序,起初写react是很难受的,尤其是jsx的写法,不过2周过后感觉写起来有点舒服了... 目前react的组件一共有3种方式:React.crea ...
- Air test ios类使用
1.iOS手机的滑动 相关代码 #python class IOS(Device): ... @property #获取屏幕的尺寸 def display_info(self): if not sel ...
- 同一个IP段ping不通同事的电脑
原因居然是同事的防火墙打开了. windows关闭防火墙的教程,请自行百度.
- HttpClient上传下载文件
HttpClient上传下载文件 java HttpClient Maven依赖 <dependency> <groupId>org.apache.httpcomponents ...
- 关于raid5的一系列问题
前几天我的一个同事在对计划采购的存储进行测试,期间聊到了raid5的话题,我和他的意见产生了分歧.他的说法是raid5不能挂太多盘是因为如果挂太多盘写惩罚会非常严重导致性能下降.而我的观点则是对于ra ...