pyenv 配置python虚拟环境
安装pyenv环境
yum -y install git
yum install gcc make patch gdbm-devel openssl-devel sqlite-devel readline-devel zlib-devel bzip2-devel
useradd python
passwd python # su - python
$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
PATH=$PATH:$HOME/bin
vim ~/.bashrc 添加以下三行
export PATH="/home/python/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
$ source ~/.bashrc python --version
pyenv
python -V pyenv versions
pyenv help install pyenv install 3.5.3
pyenv install 3.5.3 -v $ mkdir ~/.pyenv/cache 下载好的包放进去,三种压缩格式的都放进去 $ pyenv versions
* system (set by /home/python/.pyenv/version)
3.5.3 [python@pythonsys ~]$ pyenv
pyenv 1.1.3
Usage: pyenv <command> [<args>] 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 只改变当前shell的版本
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 <command>' for information on a specific command. $ mkdir py3.5.3
cd py3.5.3
[python@pythonsys ~]$ pyenv version
system (set by /home/python/.pyenv/version)
[python@pythonsys ~]$ pyenv versions
* system (set by /home/python/.pyenv/version)
3.5.3 子目录继承 会将下载的压缩包也保存在cache目录中
[python@pythonsys .pyenv]$ pyenv install 3.6.2 -v
[python@pythonsys .pyenv]$ ls /home/python/.pyenv/cache/
Python-3.6.2.tar.gz [python@pythonsys cmdb]$ pyenv versions
* system (set by /home/python/.pyenv/version)
3.5.3
3.6.1
3.6.2
[python@pythonsys cmdb]$ pyenv virtualenv 3.5.3 magedu353. 多人协作开发使用虚拟环境,避免公共目录envs混乱
Requirement already satisfied: setuptools in /home/python/.pyenv/versions/3.5.3/envs/magedu353/lib/python3.5/site-packages
Requirement already satisfied: pip in /home/python/.pyenv/versions/3.5.3/envs/magedu353/lib/python3.5/site-packages
[python@pythonsys cmdb]$ pyenv version
system (set by /home/python/.pyenv/version)
[python@pythonsys cmdb]$ pyenv versions
* system (set by /home/python/.pyenv/version)
3.5.3
3.5.3/envs/magedu353
3.6.1
3.6.2
magedu353
[python@pythonsys cmdb]$ pyenv local magedu353
(magedu353) [python@pythonsys cmdb]$ pyenv version
magedu353 (set by /home/python/magedu/project/cmdb/.python-version)
(magedu353) [python@pythonsys cmdb]$ pyenv versions
system
3.5.3
3.5.3/envs/magedu353
3.6.1
3.6.2
* magedu353 (set by /home/python/magedu/project/cmdb/.python-version)
(magedu353) [python@pythonsys cmdb]$
pyenv 配置python虚拟环境的更多相关文章
- 如何在Mac中配置Python虚拟环境,踩了好多坑
如何在Mac中配置Python虚拟环境 1.安装virtualenv pip3 install virtualenv 2.安装virtualenvwrapper pip3 install virtua ...
- 配置Python虚拟环境
最小化安装的centos7中并没有安装python3 1.安装python3 1)下载安装包: wget https://www.python.org/ftp/python/3.6.2/Python- ...
- 1.1、配置Python虚拟环境
安装虚拟环境 系统:CentOS 7.2 python版本:Python 2.7.5 1.虚拟环境介绍 虚拟环境是Python解释器的一个私有副本,在这个环境中你可以安装私有包,而且不会影响系统中安装 ...
- 配置python虚拟环境Virtualenv及pyenv
pyenv pyenv 可以让机器安装各种不同版本的python pyenv install --list 查看可以安装的python版本 pyenv versions 查看已安装的python版本 ...
- Ubuntu中配置Python虚拟环境Virtualenv
Ubuntu版本为18.04 Virtualenv介绍 在开发Python应用程序的时候,系统安装的Python3只有一个版本:3.4.所有第三方的包都会被pip安装到Python3的site-pac ...
- window10配置python虚拟环境的路径
当我们搭建python+django项目的时候,需要配置虚拟环境,从而使项目与项目之间的包相互隔离,互不影响. 1.配置虚拟环境前,首先需要安装两个包 pip install virtualenvwr ...
- jinkins配置python虚拟环境
cd /root/.virtualenvs . automationVenv/bin/activate cd /home/wangju/gitProject/automationtest#cd pyt ...
- Windows Python虚拟环境配置(Distribute + pip + virtualenv + virtualenvwrapper-powershell)
对于Python开发新手,很多人会迷茫那些各种名目的工具和概念,如Python2.7, Python3.3, Distribute, pip, virtualenv,Setuptools, easy_ ...
- Python虚拟环境和requirements.txt文件的使用
参考: https://www.centos.bz/2018/05/centos-7-4-%E5%AE%89%E8%A3%85python3%E5%8F%8A%E8%99%9A%E6%8B%9F%E7 ...
随机推荐
- sublime text3 JS语法检测插件
首先ctrl+shift+P用包管理器安装sublimeLinter和sublimeLinter-jshint 前往node官网下载nodejs并安装 安装完node后打开命令行输入npm insta ...
- 《JavaWeb从入门到改行》很好的复习资料: SQL语句到底怎么写 ?
本文用到的数据库如下: CREATE DATABASE exam; /创建部门表/ CREATE TABLE dept( deptno INT PRIMARY KEY, dname ), loc ) ...
- ES6学习笔记(一)-变量的解构赋值
变量的解构赋值种类 解构(Destructuring):ES6 允许按照一定模式,从数组和对象中提取值,对变量进行赋值. 只有当一个数组成员严格等于(===)undefined,包括空“ ” ,默认值 ...
- JQuery漂浮广告代码
<!doctype html><html><head><meta charset="utf-8"><title>jque ...
- C# 字符串中英文对齐
StringBuilder str = new StringBuilder(); str.AppendFormat( - Encoding.Default.GetBytes(); str.Append ...
- sql按中文数字排序
有表4张 建表和插入数据sql DECLARE @p_Building TABLE ( id INT , BidName ) ); DECLARE @p_Room TABLE ( id INT , R ...
- HTML中的嵌入技术
到目前为止,您应该掌握了将图像\视频和音频嵌入到网页上的诀窍了.此刻,让我们进行深入学习,来看一些能让您在网页中嵌入各种内容类型的元素: <iframe>, <embed> 和 ...
- 利用open live writer工具的Metaweblog技术API接口同步到多个博客。
测试例子内容: hello world hello metaweblog hello open live writer
- python判断一个数字是整数还是浮点数&判断整除
判断整数还是浮点数 >>> a=123 >>> b=123.123 >>> isinstance(a,int) True >>&g ...
- 131.005 Unsupervised Learning - Cluster | 非监督学习 - 聚类
@(131 - Machine Learning | 机器学习) 零. Goal How Unsupervised Learning fills in that model gap from the ...