已安装程序包中缺少模块

2024-06-18 13:11:46 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经安装并尝试使用fbconsole:https://github.com/facebook/fbconsole/

看看说明书,我可以让前几个步骤起作用:

import fbconsole

fbconsole.AUTH_SCOPE = ['publish_stream', 'publish_checkins']
fbconsole.authenticate()

但当我尝试

fbconsole.logout()

我明白了

AttributeError: 'module' object has no attribute 'logout'

查看正在安装的文件,我确实看到了authenticate()和logout()模块。软件包是否安装不正确?你知道吗


Tags: httpsimportgithubcomauthstreamfacebook步骤
2条回答

在python路径中是否有与fbconsole.py或python包fbconsole相同的名称?
如果是,那么:

import fbconsole
print fbconsole.__file__
print dir(fbconsole)  # look if the logout in the fcconsole module

然后看看你导入的fbconsole模块的文件是什么

如果没有,您可以尝试删除FBC控制台.pyc在您的python路径中(只需使用上面相同的代码),看起来它是有效的。你知道吗

对我来说这是正确的工作!你知道吗

使用以下命令重新安装fbconsole:

python setup.py install

我也希望这对你有用!你知道吗

祝你好运

相关问题 更多 >