Linux下查看site-packages/dist-packages路径

[root@localhost neutron]# python
Python 2.7.5 (default, Oct 30 2018, 23:45:53) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.sysconfig import get_python_lib
>>> print(get_python_lib())
/usr/lib/python2.7/site-packages
>>> exit

q@mas:/opt/Python-3.7.3$ python
Python 3.6.8 (default, Jan 14 2019, 11:02:34) 
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.sysconfig import get_python_lib
>>> print(get_python_lib())
/usr/lib/python3/dist-packages
>>> exit
Use exit() or Ctrl-D (i.e. EOF) to exit
>>> exit()

你可能感兴趣的:(Linux)