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 ...
随机推荐
- C# 批量 json 读取
// 方法一 //string test = "[{ 'CreateUser': 'CN=koujirou nishikawaOMHBK','CreateUserJ': '西川 公二郎'}, ...
- FisherYates费雪耶兹随机置乱算法
public class FisherYates { public static void main(String[] args) { int[] arr = new int[10]; // 初始有序 ...
- spss C# 二次开发 学习笔记(四)——Spss授权
Spss的授权方式有两种,单机版和网络版. Spss的激活,在联网的情况下,通过20位的激活码激活,在未联网的情况下,Spss根据机器获取一个类似4-XXXX的锁定码,然后由激活码和锁定码算出一个授权 ...
- 实习小结(三)--- 权限管理(RBAC)
这一周,大多数时间 用来做需求分析,细化每个页面需要实现的功能.由于这个项目需要四种身份登录查看,分别是学生,老师,领导,管理员.每个身份登入系统显示得页面都不相同,四个角色分析完成后,统计了一下页面 ...
- Keras 自适应Learning Rate (LearningRateScheduler)
When training deep neural networks, it is often useful to reduce learning rate as the training progr ...
- C++ 线程学习
原文:http://blog.csdn.net/wzy_1988/article/details/46562921 线程的概念 C++中的线程的Text Segment和Data Segment都是共 ...
- Sql server 查询数据库中包含某字段的所有的表
我们有时候会需要查询数据库中包含某字段的所有的表,去进行update,这时就可以用下面的SQL来实现: select object_name(id) objName,Name as colName f ...
- 由Dialog里面嵌套ListView之后的高度自适应引起的ListView性能优化
先说ListView给高的正确做法. android:layout_height属性: 必须将ListView的布局高度属性设置为非"wrap_content"(可以是" ...
- forkjoin框架疑问记录
今天在看jdk1.7的forkjoin框架时候,里面有个例子如下: product类: public class Product { private String name; private doub ...
- CPU纯软件半虚拟化技术
在2003年出现的Xen,使用了另外的一种半虚拟化的方案来解决x86架构下CPU的敏感指令问题.主要采用Hypercall技术.Guest OS的部分代码被改变,从而使Guest OS会将和特权指令相 ...