zoukankan      html  css  js  c++  java
  • Windows 7 64bit Python 2 Install

    安装 setuptools 出现 UnicodeDecodeError

    文件 Lib/mimetypes.py 中的 bug, 通过以下 patch 修复:

    Index: Lib/mimetypes.py
    ===================================================================
    --- Lib/mimetypes.py (revision 85786)
    +++ Lib/mimetypes.py (working copy)
    @@ -27,6 +27,7 @@
    import sys
    import posixpath
    import urllib
    +from itertools import count
    try:
    import _winreg
    except ImportError:
    @@ -239,19 +240,11 @@
    return
    
    def enum_types(mimedb):
    - i = 0
    - while True:
    + for i in count():
    try:
    - ctype = _winreg.EnumKey(mimedb, i)
    + yield _winreg.EnumKey(mimedb, i)
    except EnvironmentError:
    break
    - try:
    - ctype = ctype.encode(default_encoding) # omit in 3.x!
    - except UnicodeEncodeError:
    - pass
    - else:
    - yield ctype
    - i += 1
    
    default_encoding = sys.getdefaultencoding()
    with _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT,

    error: Unable to find vcvarsall.bat

    For Windows installations:

    While running setup.py for package installations Python 2.7 searches for an installed Visual Studio 2008. You can trick Python to use a newer Visual Studio by setting the correct path in VS90COMNTOOLS environment variable before calling setup.py.

    If you have Visual Studio 2010 installed, execute

    SET VS90COMNTOOLS=%VS100COMNTOOLS%

    or with Visual Studio 2012 installed (Visual Studio Version 11)

    SET VS90COMNTOOLS=%VS110COMNTOOLS%

    or with Visual Studio 2013 installed (Visual Studio Version 12)

    SET VS90COMNTOOLS=%VS120COMNTOOLS%
  • 相关阅读:
    菖蒲河公园-中山公园-天安门广场一日游
    LeetCode 485 Max Consecutive Ones
    LeetCode 766. Toeplitz Matrix
    LeetCode 566 Reshape the Matrix
    LeetCode 561. Array Partition I
    算法学习系列之(1):常用算法设计方法
    纪念2017,展望2018
    Java server数据之(4):Redis鸟瞰
    《机器学习》读书笔记-第一章 引言
    node.js实践第二天
  • 原文地址:https://www.cnblogs.com/ouuy/p/3528374.html
Copyright © 2011-2022 走看看