Usage:
D:\Python27\python.exe -m pip [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 to a verbose appending log.
--proxy Specify a proxy in the form
[user:passwd@]proxy.server:port.
--retries Maximum number of retries each connection should
attempt (default 5 times).
--timeout Set the socket timeout (default 15 seconds).
--exists-action Default action when a path already exists:
(s)witch, (i)gnore, (w)ipe, (b)ackup.
--trusted-host Mark this host as trusted, even though it does
not have valid or any HTTPS.
--cert Path to alternate CA bundle.
--client-cert Path to SSL client certificate, a single file
containing the private key and the certificate
in PEM format.
--cache-dir Store the cache data in .
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't 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 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
再试: