EC2模块的TypeError在我的电脑上运行正常

2024-05-20 13:16:11 发布

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

我正在使用instabot_py模块自动化一些社交媒体流程。这涉及检查变量是否高于某个值(即,如果追随者>;0)。它在我的PC上通过命令行和Eclipse都可以正常工作,但在EC2上运行它时会抛出一个TypeError

我尝试过更新python版本并绕过这些检查,但它们对流程至关重要。self.bot.follow_time的默认值为0

Traceback (most recent call last):
  File "/home/ec2-user/.local/bin/instabot-py", line 10, in <module>
    sys.exit(main())
  File "/home/ec2-user/.local/lib/python3.6/site-packages/instabot_py/__main__.py", line 252, in main
    bot.mainloop()
  File "/home/ec2-user/.local/lib/python3.6/site-packages/instabot_py/instabot.py", line 756, in mainloop
    self.new_auto_mod_unfollow()
  File "/home/ec2-user/.local/lib/python3.6/site-packages/instabot_py/instabot.py", line 899, in new_auto_mod_unfollow
    user = self.persistence.get_username_to_unfollow_random()
  File "/home/ec2-user/.local/lib/python3.6/site-packages/instabot_py/persistence/sql.py", line 95, in get_username_to_unfollow_random
    if self.bot.follow_time > 0:
TypeError: '>' not supported between instances of 'str' and 'int' 

不应出现错误消息,逻辑应按预期运行


Tags: inpyselfhomelibpackageslocalbot