python虚拟环境Virtualenvwrapper无法升降级虚拟环境软件解决方法
virtualenv用于创建独立的Python环境,多个Python相互独立,互不影响,它能够在没有权限的情况下安装新套件,不同应用可以使用不同的套件版本,套件升级不影响其他应用。
Virtaulenvwrapper则是virtualenv的扩展包,用于更方便管理虚拟环境,如,新增,删除,复制,切换等。
最近在利用Virtaulenvwrapper的mkvirtualenv创建Python虚拟环境的时候,发现在创建的虚拟环境中升级django为1.8的时候,出现无法升级的状况:(机器外部已经安装django-1.6.10)
shenweiyan@localhost :: ~ => workon test (test)shenweiyan@localhost :: ~ => pip install --upgrade django==1.8 You are using pip version , however version is available. You should consider upgrading via the 'pip install --upgrade pip' command. Collecting django==1.8 Using cached Django-1.8-py2.py3-none-any.whl Installing collected packages: django Found existing installation: Django Not uninstalling Django at /usr/local/python2./lib/python2./site-packages, outside environment /App/pyweb/test Successfully installed django-
提示无法在/usr/local/python2.7/lib/python2.7/site-packages安装django-1.8。其原因就在于在全局环境变量中已经指定了PYTHONPATH,所以在安装django的时候会把1.8的版本默认安装到指定的PYTHONPATH下,从而导致django-1.8无法成功安装。
root@localhost :: ~ => cat /etc/profile ...... export PATH=/usr/local/python2./bin:$PATH export PYTHONPATH=/usr/local/python2./lib/python2./site-packages:/usr/lib/python2./site-packages:$PYTHONPATH
所以,把/etc/profile全局变量中的PYTHONPATH注释掉,再重新登录虚拟环境进行安装升级就ok了。
shenweiyan@localhost :: ~ => workon test (test)shenweiyan@localhost :: ~ (test)shenweiyan@localhost :: ~ => pip You are using pip version , however version is available. You should consider upgrading via the 'pip install --upgrade pip' command. Collecting django== Using cached Django--py2.py3-none-any.whl Installing collected packages: django Found existing installation: Django Uninstalling Django-: Successfully uninstalled Django- Successfully installed django-
ok,问题解决!!!
python虚拟环境Virtualenvwrapper无法升降级虚拟环境软件解决方法的更多相关文章
- Python使用easy-install安装时报UnicodeDecodeError的解决方法
Python使用easy-install安装时报UnicodeDecodeError的解决方法,有需要的朋友可以参考下. 问题描述: 在使用easy-install安装matplotlib.pypar ...
- Ubuntu下 fatal error: Python.h: No such file or directory 解决方法
参考: fatal error: Python.h: No such file or directory Ubuntu下 fatal error: Python.h: No such file or ...
- Ubuntu不支持rpm安装软件解决方法
Ubuntu不支持rpm安装软件解决方法 以前经常使用的是RedHat Linux,习惯使用rpm方法安装软件.最近发现Ubuntu系统居然不支持rpm方法安装软件,提示信息如下: root@root ...
- Python使用suds调用webservice报错解决方法:AttributeError: 'Document' object has no attribute 'set'
使用python的suds包调用webservice服务接口,报错:AttributeError: 'Document' object has no attribute 'set' 调用服务接口代码: ...
- python安装途中遇到的问题和解决方法
一.setuptools安装错误:RuntimeError: Compression requires the (missing) zlib module 1. 描述 搞了个腾讯云的服务器,闲在手上没 ...
- Python中pip install MySQL-python报错解决方法
环境 Centos 7(其他Centos或者RHEL一样) 问题 在执行 pip install MySQL-python 时报错如: Command "python setup.py eg ...
- Python: 安装 sklearn 包出现错误的解决方法
今天在安装 Python 的 sklearn 包时出现了 Cannot uninstall 'numpy' 和 Cannot uninstall 'scipy' 错误,下面记录了我尝试了很多网上的方法 ...
- Python使用request包请求网页乱码解决方法
使用requests请求网页时,返回的页面信息有时是乱码,如下代码 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) App ...
- 如何解决Python下 pip install module 下载慢解决方法?
对于Python来编程的用户最大的一个痛点就是,下载模块是下载速度特别慢,那么有没有解决方法呢? 换Python的pip下载源 1.首先安装一个模块 pqi,在cmd下 pip install pqi ...
随机推荐
- javaweb jsp页面上传excel文件
servlet: private static final long FILE_MAX_SIZE = 4 * 1024 * 1024; if (!ServletFileUpload.isMultipa ...
- 【转】iOS代码规范
原文地址: http://www.cocoachina.com/ios/20150908/13335.html 简介: 本 文整理自Apple文档<Coding Guidelines for C ...
- Hibernate HQL基础 使用参数占位符
在HQL中有两种方法实现使用参数占用符 1.使用? 使用?设置参数占位符,之后通过setString()和setInteger()等方法为其赋值.如: Query query = session.cr ...
- Primo Ramdisk配置教程
首先感谢xiaohu在太平洋电脑网上发表的“将内存当硬盘用!Primo Ramdisk图文教程”,本文主要是将其图文整理了一下,以方便以后使用. 原文地址:http://fashion.pconlin ...
- MySQL调试
http://dev.mysql.com/doc/refman/5.5/en/signal.html#signal-condition-information-items http://www.dev ...
- 【转】基于V4L2的视频驱动开发
编写基于V4L2视频驱动主要涉及到以下几个知识点:1> 摄像头方面的知识 要了解选用的摄像头的特性,包括访问控制方法.各种参数的配置方法.信号输出类型等.2> Camera解码器.控制器 ...
- Bridging signals(二分 二分+stl dp)
欢迎参加——每周六晚的BestCoder(有米!) Bridging signals Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 6 ...
- 在web应用程序中使用MemcachedClient
本文来自:http://www.cnblogs.com/yukaizhao/archive/2008/11/10/memcached_client_usage.html 一. 背景: 在大访问量的we ...
- 使用lock_sga和pre_page_sga参数保证SGA常驻物理内存 .
Lock_sga LOCK_SGA locks the entire SGA into physical memory. It is usually advisable to lock the SGA ...
- java中23种设计模式
详情请看23种设计模式