How do I find the location of my Python site-packages directory?

前端 未结 21 2679
梦谈多话
梦谈多话 2020-11-22 03:06

How do I find the location of my site-packages directory?

21条回答
  •  感情败类
    2020-11-22 03:30

    >>> import site; site.getsitepackages()
    ['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
    

    (or just first item with site.getsitepackages()[0])

提交回复
热议问题