查看pip install安装的python包的位置

例如,我在一个名为tf_14的vertualenv环境中(no-site-package)安装了一个contextlib2包

(tf_14) novak@novak-ZBook15G2:~/Carnd3/kinshuk4_tl_detection/CarND-TrafficLight-Classification$ pip install contextlib2
Collecting contextlib2
  Downloading https://files.pythonhosted.org/packages/a2/71/8273a7eeed0aff6a854237ab5453bc9aa67deb49df4832801c21f0ff3782/contextlib2-0.5.5-py2.py3-none-any.whl
Installing collected packages: contextlib2
Successfully installed contextlib2-0.5.5

使用which xxx来查看

使用pip show指令来查看

(tf_14) novak@novak-ZBook15G2:~/Carnd3/kinshuk4_tl_detection/CarND-TrafficLight-Classification$ pip show contextlib2
Name: contextlib2
Version: 0.5.5
Summary: Backports and enhancements for the contextlib module
Home-page: http://contextlib2.readthedocs.org
Author: Nick Coghlan
Author-email: ncoghlan@gmail.com
License: PSF License
Location: /home/novak/tf_14/lib/python2.7/site-packages
Requires: 
Required-by: