只有在使用pyinstaller' .exe'运行Reddit bot时file:AttributeError:' _NotSet'对象没有属性' lower'

时间:2017-09-15 23:09:34

标签: python reddit praw

出于某种原因,每当我尝试为我的reddit bot运行pyinstaller生成的.exe文件时,我都会遇到以下错误(在登录期间):

Traceback (most recent call last):
  File "main.py", line 23, in <module>
  File "main.py", line 11, in run
  File "login.py", line 14, in do
  File "praw\reddit.py", line 129, in __init__
  File "praw\config.py", line 72, in __init__
  File "praw\config.py", line 98, in _initialize_attributes
  File "praw\config.py", line 31, in _config_boolean
AttributeError: '_NotSet' object has no attribute 'lower'
Failed to execute script main

但是当我在PyCharm中运行它时一切都很好 - 没有错误,一切都是100%功能。

我只安装了Python 3.4,没有其他版本。

这是登录代码(已更改身份验证值):

import praw

username = '4_the_wolf_x'
password = 'password'
client_id = 'xxxx_xxxxxxxxxx'
client_secret = 'xxxxxxxxxxxxxxxx'
APP_UA = '4thewolfx.com'

def do():
    session = praw.Reddit(
            username = username,
            password = password,
            client_id = client_id,
            client_secret = client_secret,
            user_agent = APP_UA
            )
    return session

似乎非常直截了当。我真的不知道这种情况下的错误是指什么。非常感谢任何帮助

0 个答案:

没有答案