Python中每一个模块都有一个内置属性__file__,可以查看模块的完整路径 例如: 查看pygame的安装路径 import pygame print(pygame.__file__) 在Windows命令行执行效果为: