pip
pip是一個專門用于下載管理python庫的軟件。
使用pip下載的庫,都會到PyPi,python官方鏡像站去下載。并且可選擇版本,apt則是只能下載最新。
她有pip和pip3的區別,當同時擁有兩個python版本時,pip3用于安裝python3的庫,pip安裝python庫。
在ubuntu下pip需要自行安裝:
- 可執行命令sudo apt-get install python3-pip安裝python3.x的pip
- 或者sudo apt-get install python-pip安裝python2.x的pip
注:安裝前最好sudo apt-get update一下
python的可執行文件的目錄一般在/usr/bin下,通過apt-get安裝的應用一般會在這個目錄.
自行安裝的一般在/usr/local/bin下。
python3.5的自帶庫目錄在:
/usr/lib/python3/dist-packages
/usr/lib/python3.5/
python2.7的自帶庫目錄在:
/usr/lib/python2.6/dist-packages
/usr/lib/python2.7/
通過pip安裝的模塊目錄在:
~/.local/lib/python3.5/site-packages
~/.local/lib/python2.7/site-packages
或者/usr/local/lib/python2.7/dist-packages