Python安裝第三方庫的3種方法

PC教程網】關于Python安裝第三方庫的3種方法_python第三方庫安裝介紹:【方法一】: 通過setuptools來安裝python模塊 首先下載 http://peak.telecommunity.com/dist/ez_setup.py NOTE: 最好下載個setuptools,本人是15.2版本,里面包含了ez_setup 運行 python ez_setup.py D:\work\installatio,下面小編為您針對Python安裝第三方庫的3種方法進行分享:

【方法一】: 通過setuptools來安裝python模塊

首先下載 http://peak.telecommunity.com/dist/ez_setup.py

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

運行 python ez_setup.py

D:\work\installation\setuptools-15.2\setuptools-15.2>python ez_setup.py > 1.txt 
Extracting in c:\users\admini~1\appdata\local\temp\tmpbxikxf 
Now working in c:\users\admini~1\appdata\local\temp\tmpbxikxf\setuptools-15.2 
Installing Setuptools 
...... 
Copying setuptools-15.2-py2.7.egg to c:\python27\lib\site-packages 
setuptools 15.2 is already the active version in easy-install.pth 
Installing easy_install-script.py script to C:\Python27\Scripts 
Installing easy_install.exe script to C:\Python27\Scripts 
Installing easy_install-2.7-script.py script to C:\Python27\Scripts 
Installing easy_install-2.7.exe script to C:\Python27\Scripts 
 
 
Installed c:\python27\lib\site-packages\setuptools-15.2-py2.7.egg 
Processing dependencies for setuptools==15.2 
Finished processing dependencies for setuptools==15.2 

運行 easy_install py

D:\work>easy_install py      #py 為第三方庫文件 
Searching for py 
Best match: py 1.4.26 
Adding py 1.4.26 to easy-install.pth file 
 
Using c:\python27\lib\site-packages 
Processing dependencies for py 
Finished processing dependencies for py 

【方法二】: 通過pip來安裝python模塊

安裝 easy_install pip

D:\work>easy_install pip 
Searching for pip 
Best match: pip 6.1.1 
Processing pip-6.1.1-py2.7.egg 
pip 6.1.1 is already the active version in easy-install.pth 
Installing pip-script.py script to C:\Python27\Scripts 
Installing pip.exe script to C:\Python27\Scripts 
Installing pip2.7-script.py script to C:\Python27\Scripts 
Installing pip2.7.exe script to C:\Python27\Scripts 
Installing pip2-script.py script to C:\Python27\Scripts 
Installing pip2.exe script to C:\Python27\Scripts 
 
Using c:\python27\lib\site-packages\pip-6.1.1-py2.7.egg 
Processing dependencies for pip 
Finished processing dependencies for pip 

運行 pip install xlrd

Usage:   
 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:[email protected]]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 
               Don't periodically check PyPI to determine 
               whether a new version of pip is available for 
               download. Implied with --no-index. 

【方法三】:直接從網上下載下可執行文件來安裝.

比如說,去 >>> pythonlibs <<< 網站,提供了很多Python非官方包下載,二進制文件,下載安裝方便.

相關教程

Redis數據庫的安裝配置方法

redis 是一個高性能的key-value數據庫。 redis的出現,很大程度補償了memcached這類keyvalue存儲的不足,在部 分場合可以對關系數據庫起到很好的補充作用。它提供了Python,Ruby,Erlang,PHP客戶 …

centos安裝mysql數據庫的方法

1、首先下載MySQL的安裝文件,我這里安裝的是MySQL5.1.7版本的, 2、安裝MySQL數據庫服務器 進入安裝包所在文件夾,執行命令 rpm -ivh MySQL-server-5.1.7-0.i386.rpm 安裝MySQL服務器。 如果報了與原 …

Mysql5.5安裝配置方法及中文亂碼的快速解決方法

1.啟動服務 windows下DOS命令窗口輸入指令: 查看服務是否啟動:net help services 啟動mysql服務:net start mysql 停止mysql服務:net stop mysql linux下在bash下,輸入指令: 查看服務狀態:service my …

Eclipse安裝配置方法圖文教程

Eclipse安裝配置方法圖文教程

直入主題,到Eclipse官網下載最新版的Eclipse,解壓后即可,不需要安裝。 運行Eclipse程序文件,打開Eclipse工作界面。 選擇菜單欄中的window——preferences。 選擇左側的 server——runtime env …

phpMyAdmin 安裝配置方法和問題解決

現作個簡單回顧:基本上應該遇到的問題都遇到了,關鍵是多查資料,多動腦子就能解決問題的。 1/無法載入mcrypt擴展,請檢查PHP配置; 2/配置文件現在需要絕密的短語密碼(blowfish_sec …

phpMyAdmin2.11.6安裝配置方法

1/無法載入mcrypt擴展,請檢查PHP配置; 2/配置文件現在需要絕密的短語密碼(blowfish_secret); 3/#2003-服務器沒有響應。 為了以備不時之需,把遇到的這些問題的解決方法歸納到飄易博客,省 …

Smarty安裝配置方法

下載最新的Smarty:http://smarty.php.net/ 當前最新版本:2.6.18 解壓后將目錄中的libs目錄重命名為smarty,復制到你的網站目錄,同時在網站根目錄下建立templates和templates_c兩個目錄 建立test.p …

SQL Server 2016 CTP2.2安裝配置方法圖文教程

SQL Server 2016 CTP2.2安裝配置方法圖文教程

SQL Server 2016 CTP2.2 安裝配置教程 下載一個iso文件,解壓出來(大約2.8G左右),在該路徑下雙擊Setup.exe即可開始安裝。 安裝之前請先安裝.NET 3.5 SP1,在服務器管理器-》添加角色和功能 …

内蒙古十一选五任五推荐号