How to find the site-packages folder in Python?

在Mac OS或者Linux中比较有用,因为这些系统一般都同时安装了多个版本。尤其是Mac OS 10.5,目录结构太乱了

在python环境中:

1
2
from distutils.sysconfig import get_python_lib
print get_python_lib()

或者,直接命令行:

1
python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
Trackback

还没有评论。

发表评论