码迷,mamicode.com
首页 > Windows程序 > 详细

win7安装pip、mitmproxy

时间:2015-01-21 18:06:41      阅读:1549      评论:0      收藏:0      [点我收藏+]

标签:

安装pip https://pip.pypa.io/en/latest/installing.html

步骤:

下载 https://bootstrap.pypa.io/get-pip.py

python get-pip.py
D:\pip>python get-pip.py
Collecting pip
  Downloading pip-6.0.6-py2.py3-none-any.whl (1.3MB)
    100% |################################| 1.3MB 74kB/s ta 0:00:011
Collecting setuptools
  Downloading setuptools-12.0.4-py2.py3-none-any.whl (502kB)
    100% |################################| 503kB 117kB/s ta 0:00:01
Installing collected packages: setuptools, pip


Successfully installed pip-6.0.6 setuptools-12.0.4
python -m pip
Usage:
  D:\Python27\python.exe -m pip <command> [options]

Commands:
  install                     Install packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  zip                         DEPRECATED. Zip individual packages.
  unzip                       DEPRECATED. Unzip individual packages.
  help                        Show help for commands.

General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring
                              environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be
                              used up to 3 times.
  -V, --version               Show version and exit.
  -q, --quiet                 Give less output.
  --log <path>                Path to a verbose appending log.
  --proxy <proxy>             Specify a proxy in the form
                              [user:passwd@]proxy.server:port.
  --retries <retries>         Maximum number of retries each connection should
                              attempt (default 5 times).
  --timeout <sec>             Set the socket timeout (default 15 seconds).
  --exists-action <action>    Default action when a path already exists:
                              (s)witch, (i)gnore, (w)ipe, (b)ackup.
  --trusted-host <hostname>   Mark this host as trusted, even though it does
                              not have valid or any HTTPS.
  --cert <path>               Path to alternate CA bundle.
  --client-cert <path>        Path to SSL client certificate, a single file
                              containing the private key and the certificate
                              in PEM format.
  --cache-dir <dir>           Store the cache data in <dir>.
  --no-cache-dir              Disable the cache.
  --disable-pip-version-check
                              Dont periodically check PyPI to determine
                              whether a new version of pip is available for
                              download. Implied with --no-index.

安装依赖包

python -m pip install netlib pyopenssl pyasn1 urwid pil lxml flask

错误:

File "D:\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 0xb0 in position 1: ordinal not in range(128)

解决方案:

打开D:\Python27\lib\mimetypes.py文件,在256行,将

default_encoding = sys.getdefaultencoding()

改为

        if sys.getdefaultencoding() != gbk:  
            reload(sys)  
            sys.setdefaultencoding(gbk)  
        default_encoding = sys.getdefaultencoding()

 由于pil安装出错,所以先:

python -m pip install netlib pyopenssl pyasn1 urwid lxml flask

然后:

python -m pip install pyamf protobuf

又出错:

error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat).
Get it from http://aka.ms/vcpython27

需要装 Microsoft Visual C++ Compiler for Python 2.7(共 83.8 MB)

http://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

再试:

python -m pip install pyamf protobuf

下一步:

python -m pip install pil --allow-external PIL --allow-unverified PIL

下一步:

python -m pip install nose pathod countershape

最后:

python -m pip install mitmproxy

 

 

 

参考资料:

https://pip.pypa.io/en/latest/installing.html
http://m.blog.csdn.net/blog/roler_/40398789
http://netsecurity.51cto.com/art/201311/416548.htm
http://www.ajucs.com/archives/565.html

win7安装pip、mitmproxy

标签:

原文地址:http://www.cnblogs.com/ShepherdIsland/p/4239052.html

(1)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!