如何找到一个python包

时间:2013-09-05 22:21:32

标签: python

我想手动卸载python包,因此无法使用import访问它。 我找不到我的系统中的包。 当我使用此advice(运行python -v)时,我有下一个输出:

# /usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/clsregistry.pyc matches /usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/clsregistry.py
import sqlalchemy.ext.declarative.clsregistry # precompiled from /usr/local/lib/python2.7/dist-packages/sqlalchemy/ext/declarative/clsregistry.pyc
# myfile.pyc matches myfile.py
import myfile # precompiled from myfile.pyc

myfile是我要卸载的软件包的一部分。

我如何找到它?

1 个答案:

答案 0 :(得分:6)

打印模块的位置:

import myfile
myfile.__file__