1. 程式人生 > >Python——檢視安裝位置和安裝的庫

Python——檢視安裝位置和安裝的庫

檢視Python 安裝位置和安裝的庫

步驟一: 
1. Start 一個command prompt 
2. 找到電腦中已經安裝的Python 位置:

where python
  • 1

開啟路徑, cd 到輸出的路徑,之後

start.
  • 1

commandPrompt 圖示 
顯示pip安裝的所有庫

pip list <or> pip freeze
  • 1

pip list

pip freeze 
檢視過時的庫

pip list --outdated
  • 1

outdated 
步驟二: 
如果是從python 的command line 裡面檢視,可以使用如下命令(python 3.x)

import sys
print(sys.path)
  • 1
  • 2

python結果

python 標準庫位置: %python安裝路徑%\Lib

Example: C:\Users\ref3oz\AppData\Local\Programs\Python\Python35\Lib

第三方庫位置: %python安裝路徑%\Lib\site-packages

Example: C:\Users\ref3oz\AppData\Local\Programs\Python\Python35\Lib\site-packages