V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
cokepro
V2EX  ›  Python

win7&64下setuptools安装失败怎么解决

  •  
  •   cokepro · 2014-02-01 19:39:39 +08:00 · 5238 次点击
    这是一个创建于 3756 天前的主题,其中的信息可能已经有所发展或是发生改变。
    显示如下
    ............
    File "C:\Python27\lib\mimetypes.py", line 358, in init

    db.read_windows_registry()

    File "C:\Python27\lib\mimetypes.py", line 258, in read_windows_registry

    for subkeyname in enum_types(hkcr):

    File "C:\Python27\lib\mimetypes.py", line 249, in enum_types

    ctype = ctype.encode(default_encoding) # omit in 3.x!

    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 33: ordinal not in range(128)
    网上遍寻无果,就这一个http://www.oschina.net/question/1409342_134600,里面的方法都试过,无效。
    5 条回复    1970-01-01 08:00:00 +08:00
    zxc111
        1
    zxc111  
       2014-02-01 20:18:30 +08:00   ❤️ 1
    别费劲了,Windows下直接去这边下人整好的包吧。。。
    http://www.lfd.uci.edu/~gohlke/pythonlibs/
    32位64位都有
    cokepro
        2
    cokepro  
    OP
       2014-02-01 20:40:14 +08:00
    真NB,这么方便的东西.多谢这位兄弟!
    larvata
        3
    larvata  
       2014-02-01 21:36:42 +08:00
    应该是由于你装了阿里旺旺的缘故
    阿狸汪汪会在注册表的minetype里注册一个中文的键 导致python不能正确转换编码
    删除那个键就能正常装了

    具体注册表位置我记不太清了 当时我是修改了mimetypes.py 把报错输出找到的键值位置
    tan9le
        4
    tan9le  
       2014-02-02 03:47:54 +08:00
    http://www.aax9.com/2014/01/21/95.html
    我上次正好也遇到了,改了mimetypes.py这个文件,我的博文里也引用了官方SVN的版本改动历史比对,供参考
    davidli
        5
    davidli  
       2014-02-08 19:59:25 +08:00
    我在64位WIN7下折腾Python, Mysql之类的东西折腾了好几天, 最后选择了装Ubuntu双系统
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1074 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 19:06 · PVG 03:06 · LAX 12:06 · JFK 15:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.