python 装 ez_setup.py 出错

python 装 ez_setup.py
出错setuptools,pip,install,UnicodeDecodeError: ‘ascii‘ codec can‘t decode byte.
解决:
打开Python27\Lib\mimetypes.py
在default_encoding = sys.getdefaultencoding() 前加后三行
if sys.getdefaultencoding() != ‘gbk‘:
reload(sys)
sys.setdefaultencoding(‘gbk‘)
default_encoding = sys.getdefaultencoding()

时间: 2024-07-29 16:26:53

python 装 ez_setup.py 出错的相关文章

python pip ez_setup.py

#!/usr/bin/env python """Bootstrap setuptools installation To use setuptools in your package's setup.py, include this file in the same directory and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools()

python 安装 ez_setup.py出现的问题及解决办法

试了网上好几个解决办法. 下面这个办法是最对我胃口的. ~~~~~~~~~~~~~~~~ 安装ez_setup.py时出现了这个问题: UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position 1: ordinal not in range(128) Something went wrong during the installation. See the error message above. 解决办法: 打开C

Python ez_setup.py安装错误

装ez_setup时,遇到了问题,报错: UnicodeDecodeError: 'ascii' codec can't decode byte 0xb0 in position ordinal not in range(128) Something went wrong during the installation. See the error message above. 现在发现,这应该都是同一个问题.原因与注册表有关,可能与某些国产软件对注册表的改写的gbk格式导致python无法进行

安装python,setuptools,get-pip.py,ipython构建python开发环境

安装python,setuptools,get-pip.py,ipython,构建python开发环境 安装环境:Centos6.7 ,安装时选项为桌面,增加了开发工具包. 1.python2.7.11安装 下载源代码: wget https://www.python.org/ftp/python/2.7.11/Python-2.7.11.tgz 安装: ./configure make make install 2.安装setuptools wget https://pypi.python.o

ez_setup.py

#!python"""Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include thisfile in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools    us

python selenium模块使用出错-selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

Python 2.7+selenium+Firefox 55.0.3 代码: from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.keys import Keys import time browser = webdriver.Firefox() # Get local session of firef

第一个Python程序hello.py提示出现File "<stdin>",line 1错误

写第一个Python程序hello.py,内容仅有一句,print 'hello world', 运行 Python hello.py 出错,提示: File "<stdin>" , line 1python hello.py SyntaxError:invalid syntax 原因: 在shell脚本中,运行shell脚本命令:在Python命令行中,运行Python代码.然而,"python hello.py"是一个脚本命令,不是python代码.

Python的__init__.py用法

python中包的引入,对于大型项目中都会使用到这个功能,把实现不同功能的python文件放在一起,组成不同lib库,然后在其他地方调用. 1.__init__.py基本介绍 首先看下面这个例子 例子1 #!/usr/bin/env python2.7 #-*- coding:utf-8 -*- from package.src.test import A a = A(2) a.aPrint() 从package包中的src子包中test.py文件中,引入A类,如何实现这一点?? 需要构建如下的

python的setup.py文件

最近工作需要,用Cython写了*.pyx扩展,并将其编译成C文件,最后转换为so扩展,供python引用 使用 distutils 编译,建立一个setup.py 的脚本 from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup( name = 'cython_build_test', cmdclass = {'b