最新消息:本站所有跳转向bbs.ykit.cn的附件将全面停止,附件已转移到https://www.qingsj.com

Python模块的查看和更新

Python 有客 124浏览

1.查看Python已安装模块
运行cmd,列出所有模块名

pip list

会出现你电脑中已安装的
C:\Users\a>pip list
Package Version
-------------------- --------
requests 2.21.0
scikit-learn 0.21.1
scimath 4.2.0
scipy 1.2.1
Scrapy 1.6.0
seaborn 0.9.0
serverfiles 0.3.0
service-identity 18.1.0
setuptools 40.8.0
six 1.12.0
sklearn 0.0
soupsieve 1.9.2
tensorboard 1.13.1
tensorflow 1.13.1
tensorflow-estimator 1.13.0
termcolor 1.1.0
traits 5.1.1
tryalgo 1.3.0
Twisted 19.2.0
typed-ast 1.4.0
typing 3.6.6
urllib3 1.24.3

2.更新Python模块,例如更新 tensorflow
python -m pip install --upgrade tensorflow

更新完成
Successfully installed google-pasta-0.1.7 setuptools-41.2.0 tensorboard-1.14.0 tenso 
rflow-1.14.0 tensorflow-estimator-1.14.0

3.pip工具的更新
python -m pip install --upgrade pip

4.查看 pip 的帮助和更多命令
pip -h
会出现
Usage:
pip <command> [options]

Commands:
install Install packages.
download Download packages.
uninstall Uninstall packages.
freeze Output installed packages in requirements format.
list List installed packages.
show Show information about installed packages.
check Verify installed packages have compatible dependencies
.
config Manage local and global configuration.
search Search PyPI for packages.
wheel Build wheels from your requirements.
hash Compute hashes of package archives.
completion A helper command used for command completion.
debug Show information useful for debugging.
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. Option is additive, and can be
used up to 3 times (corresponding to WARNING, ERROR,
and CRITICAL logging levels).
--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, (a)bort.
--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
Don't periodically check PyPI to determine whether a
new version of pip is available for download.
Implied with --no-index.
--no-color Suppress colored output

 

转载请注明:有客帮 » Python模块的查看和更新