virtualenv用于创建独立的Python环境,多个Python相互独立,互不影响,它能够在没有权限的情况下安装新套件,不同应用可以使用不同的套件版本,套件升级不影响其他应用. Virtaulenvwrapper则是virtualenv的扩展包,用于更方便管理虚拟环境,如,新增,删除,复制,切换等. 最近在利用Virtaulenvwrapper的mkvirtualenv创建Python虚拟环境的时候,发现在创建的虚拟环境中升级django为1.8的时候,出现无法升级的状况:(机器外部已经安装…
Python使用easy-install安装时报UnicodeDecodeError的解决方法,有需要的朋友可以参考下. 问题描述: 在使用easy-install安装matplotlib.pyparsing时一直报如下错误: File "G:\Python27\lib\ntpath.py", line 84, in join result_path = result_path + p_path UnicodeDecodeError: 'ascii' codec can't decod…
参考: fatal error: Python.h: No such file or directory Ubuntu下 fatal error: Python.h: No such file or directory 解决方法 根据使用的Python版本安装python-dev库. sudo apt-get install python-dev # for python2.x installs sudo apt-get install python3-dev # for python3.x i…
Ubuntu不支持rpm安装软件解决方法 以前经常使用的是RedHat Linux,习惯使用rpm方法安装软件.最近发现Ubuntu系统居然不支持rpm方法安装软件,提示信息如下: root@root$ rpm -i package.rpm The program 'rpm' is currently not installed.  You can install it by typing: sudo apt-get install rpm 然而通过apt-get安装rpm包以后依然不能够安装,…
使用python的suds包调用webservice服务接口,报错:AttributeError: 'Document' object has no attribute 'set' 调用服务接口代码: #coding=utf-8 from suds.client import Client client = Client('http://port.patentstar.cn/bns/PtDataSvc.asmx?wsdl') print client pt = client.factory.cr…
一.setuptools安装错误:RuntimeError: Compression requires the (missing) zlib module 1. 描述 搞了个腾讯云的服务器,闲在手上没事准备当个测试机用用,写写代码什么的.然后按照之前写的文章安装了python2.7,安装的中途出现了一个错误:   1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34…
环境 Centos 7(其他Centos或者RHEL一样) 问题 在执行 pip install MySQL-python 时报错如: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-P6IAnP/mysql-python/ 解决方法 缺少mysql-devel yum install -y mysql-devel 如果不行请执行以下安装更多 yum install -y pyt…
今天在安装 Python 的 sklearn 包时出现了 Cannot uninstall 'numpy' 和 Cannot uninstall 'scipy' 错误,下面记录了我尝试了很多网上的方法后最终成功的解决方法. 终端执行 pip install scikit-learn 后,出现 Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine w…
使用requests请求网页时,返回的页面信息有时是乱码,如下代码 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36' } def get_all(url,key): params = { 'keyword':key, 'enc':'utf-8' } response = r…
对于Python来编程的用户最大的一个痛点就是,下载模块是下载速度特别慢,那么有没有解决方法呢? 换Python的pip下载源 1.首先安装一个模块 pqi,在cmd下 pip install pqi 2.查看pqi,相关命令 3.查看镜像源 可以看出镜像源有 豆瓣的.清华.pypi.阿里云等 4.查看当前源 python默认的pip 源是pypi 5.更换pip源,pip use xxx,可以随意选一个之前查看的源,推荐使用阿里云速度还是可以的. 至此,关于Python解决pip 下载速度慢的…