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

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

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

21条回答
  •  别跟我提以往
    2020-11-22 03:24

    A side-note: The proposed solution (distutils.sysconfig.get_python_lib()) does not work when there is more than one site-packages directory (as recommended by this article). It will only return the main site-packages directory.

    Alas, I have no better solution either. Python doesn't seem to keep track of site-packages directories, just the packages within them.

提交回复
热议问题