import robin_stocks as r
r.login(config.username, config.password)我使用robin_stocks模块在Atom中编写了一个脚本,它在我的Mac上运行没有错误,但是当我将代码转移到Google Cloud VM时,出现了错误AttributeError: module 'robin_stocks' has no attribute 'login'。
我知道这个模块确实有这个属性,因为我已经能够在Atom中运行它(并使用hasattr()函数来确认该属性是否存在),而且https://robin-stocks.readthedocs.io/en/latest/functions.html声明login()是一个属性。
我知道这里也有类似的关于没有属性的模块的问题,但我看到的解决方案都没有帮助我解决这个问题。
请耐心等待,这是我的第一篇文章。
发布于 2021-04-26 05:33:13
我通过将“将robin_stocks导入为r”改为“将robin_stocks.robinhood导入为r”修复了此问题。
https://stackoverflow.com/questions/62903482
复制相似问题