Window下python 2.73安装pip
来源:互联网 发布:影子网络真的很恐怖吗 编辑:程序博客网 时间:2024/06/08 19:46
(1)安装pip到官网下载.gz文件,解压后在其目录下执行cmd
命令:pyhton setup.py install
安装完成后将pip.exe所在的目录添加到系统路径便于调用
发现【ImportError: No module named setuptools】提示先要安装setuotools(2)使用https://bootstrap.pypa.io/ez_setup.py脚本(新建一个txt将所有内容拷贝下来改名为ez setup.py)安装setuptools 命令:pyhton ez setup.py install
可能遇到的错误【UnicodeDecodeError: 'ascii' codec can't decode byte 0xd3 in position 9: ordinal not in range(128)】
说明:这里有很多方法,例如在lib/mimify.py进行处理,但后来试了不行,采用下面的方法可行
解决方法:在python/lib/site.py中加入 (若有import sys ,则该句省略)
import sys
reload(sys)
sys.setdefaultencoding('gbk')
Unicode Default Encoding
The Unicode implementation has to make some assumption about the encoding of 8-bit strings passed to it for coercion and about the encoding to as default for conversion of Unicode to strings when no specific encoding is given. This encoding is called <default encoding> throughout this text. For this, the implementation maintains a global which can be set in the site.py Python startup script. Subsequent changes are not possible. The <default encoding> can be set and queried using the two sys module APIs: sys.setdefaultencoding(encoding) --> Sets the <default encoding> used by the Unicode implementation. encoding has to be an encoding which is supported by the Python installation, otherwise, a LookupError is raised. Note: This API is only available in site.py! It is removed from the sys module by site.py after usage. sys.getdefaultencoding() --> Returns the current <default encoding>. If not otherwise defined or set, the <default encoding> defaults to 'ascii'. This encoding is also the startup default of Python (and in effect before site.py is executed). Note that the default site.py startup module contains disabled optional code which can set the <default encoding> according to the encoding defined by the current locale. The locale module is used to extract the encoding from the locale default settings defined by the OS environment (see locale.py). If the encoding cannot be determined, is unknown or unsupported, the code defaults to setting the <default encoding> to 'ascii'. To enable this code, edit the site.py file or place the appropriate code into the sitecustomize.py module of your Python installation.
参考博文(1)关于unicode编码错误的解决思路
阅读全文
0 0
- Window下python 2.73安装pip
- window下安装python、pip,numpy、python-opencv
- python在window下使用pip安装模块
- python下安装pip
- window安装python 的pip模块
- win7下安装python pip
- python下pip的安装
- Windows下安装Python PIP
- windows下安装python pip
- Python下pip安装scrapy
- CentOS7下安装python-pip
- centos7下安装Python-pip
- CentOS7下安装python-pip
- windowss下python安装pip
- CentOS7下安装python-pip
- Linux下python安装pip
- window下python3里pip安装mysql-python失败问题回答解决
- window上装python,pip
- 1321:棋盘问题
- 【搜狐笔试题】产品包装
- Python 3实现k-邻近算法以及 iris 数据集分类应用
- 正则表达式整理
- java解析HL7协议报文工具(v24版)
- Window下python 2.73安装pip
- Directx9学习(八)初识texture(3)
- haoi2013软件安装解题报告
- Over子句开窗函数
- java笔记(七)ServerSocket跟Socket
- 小试牛刀
- Devexpress:在GridControl中使用BindingList
- 解决Hibernate 注解在属性上 ,多对一,一对一懒加载 当调用one那一方getId 也会查数据库的问题
- linux下搭建git服务器全过程