Python安装第三方库的三种方法

【方法一】:通过setuptools来安装python模块首先下载

NOTE: 最好下载个setuptools,本人是15.2版本,里面包含了ez_setup

运行 python ez_setup.pyD:\work\installation\setuptools-15.2\setuptools-15.2>python ez_setup.py > 1.txtExtracting in c:\users\admini~1\appdata\local\temp\tmpbxikxfNow working in c:\users\admini~1\appdata\local\temp\tmpbxikxf\setuptools-15.2Installing Setuptools……Copying setuptools-15.2-py2.7.egg to c:\python27\lib\site-packagessetuptools 15.2 is already the active version in easy-install.pthInstalling easy_install-script.py script to C:\Python27\ScriptsInstalling easy_install.exe script to C:\Python27\ScriptsInstalling easy_install-2.7-script.py script to C:\Python27\ScriptsInstalling easy_install-2.7.exe script to C:\Python27\ScriptsInstalled c:\python27\lib\site-packages\setuptools-15.2-py2.7.eggProcessing dependencies for setuptools==15.2Finished processing dependencies for setuptools==15.2运行 easy_install pyD:\work>easy_install py#py 为第三方库文件Searching for pyBest match: py 1.4.26Adding py 1.4.26 to easy-install.pth fileUsing c:\python27\lib\site-packagesProcessing dependencies for pyFinished processing dependencies for py【方法二】:通过pip来安装python模块安装 easy_install pipD:\work>easy_install pipSearching for pipBest match: pip 6.1.1Processing pip-6.1.1-py2.7.eggpip 6.1.1 is already the active version in easy-install.pthInstalling pip-script.py script to C:\Python27\ScriptsInstalling pip.exe script to C:\Python27\ScriptsInstalling pip2.7-script.py script to C:\Python27\ScriptsInstalling pip2.7.exe script to C:\Python27\ScriptsInstalling pip2-script.py script to C:\Python27\ScriptsInstalling pip2.exe script to C:\Python27\ScriptsUsing c:\python27\lib\site-packages\pip-6.1.1-py2.7.eggProcessing dependencies for pipFinished processing dependencies for pip运行 pip install xlrdUsage:pip <command> [options]Commands: installInstall packages. uninstallUninstall packages. freezeOutput installed packages in requirements format. listList installed packages. showShow information about installed packages. searchSearch PyPI for packages. wheelBuild wheels from your requirements. zipDEPRECATED. Zip individual packages. unzipDEPRECATED. Unzip individual packages. helpShow help for commands.General Options: -h, –helpShow help. –isolatedRun pip in an isolated mode, ignoringenvironment variables and user configuration. -v, –verboseGive more output. Option is additive, and can beused up to 3 times. -V, –versionShow version and exit. -q, –quietGive 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 shouldattempt (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 doesnot have valid or any HTTPS. –cert <path>Path to alternate CA bundle. –client-cert <path>Path to SSL client certificate, a single filecontaining the private key and the certificatein PEM format. –cache-dir <dir>Store the cache data in <dir>. –no-cache-dirDisable the cache. –disable-pip-version-checkDon't periodically check PyPI to determinewhether a new version of pip is available fordownload. Implied with –no-index.

直接从网上下载下可执行文件来安装.

比如说,去 >>>pythonlibs<<<网站,提供了很多Python非官方包下载,二进制文件,,下载安装方便.

有人说,幸福是一种人生的感悟,一种个人的体验。

Python安装第三方库的三种方法

相关文章:

你感兴趣的文章:

标签云: