python 获取加载模块路径

悟透 / 2023-07-14 / 原文

方法一:

python3 -c "import sys; print(sys.path)"

效果:
image


方法二:

python3
import sys
print(sys.path)

效果:
image





参考:
https://www.zhihu.com/question/603263580?utm_id=0