哪个包'导入twitter'导入?

时间:2022-12-20 02:45:47

I have both twitter 1.17.0 and python-twitter 2.2 installed. They both use

我安装了twitter 1.17.0和python-twitter 2.2。他们都使用

import twitter

How do I know which one is being imported?

我怎么知道哪一个被导入?

1 个解决方案

#1


You should be able to find out where the module is defined with inspect.getfile() function like this:

您应该能够找到使用inspect.getfile()函数定义模块的位置,如下所示:

import twitter
from inspect import getfile

print(getfile(twitter))

#1


You should be able to find out where the module is defined with inspect.getfile() function like this:

您应该能够找到使用inspect.getfile()函数定义模块的位置,如下所示:

import twitter
from inspect import getfile

print(getfile(twitter))