2016-09-15 2 views
1

이 작업을 수행하는 방법을 모르겠습니다. 내 앱에서도 client_id를 찾을 수 없습니다. 난 그냥이 응용 프로그램의 비밀을 참조하십시오ClientException 발생 (required_message.format (attribute)) praw.exceptions.ClientException : 필수 구성 설정 'client_id'가 누락되었습니다.

>>> import praw 
>>> r = praw.Reddit(user_agent='custom data mining framework', 
... site_name='lamiastella') 
Traceback (most recent call last): 
    File "<stdin>", line 2, in <module> 
    File "/usr/local/lib/python2.7/dist-packages/praw/reddit.py", line 101, in __init__ 
    raise ClientException(required_message.format(attribute)) 
praw.exceptions.ClientException: Required configuration setting 'client_id' missing. 
This setting can be provided in a praw.ini file, as a keyword argument to the `Reddit` class constructor, or as an environment variable. 

여기가 맞습니다 또는 모든 필요한 필드가 있는지 확실하지 오전 내 praw.ini 파일 : 어떤 도움이 정말 감사합니다

[lamiastella] 
domain: www.monajalal.com 
user: lamiastella 
pswd: mypassword 

가.

** reddit에서 praw를 사용하여 이미지를 검색 할 수 있습니까? 또는 무엇을 제안합니까?

답변

2

praw.ini 파일 또는 Python 스크립트에서 client_id (고유 한 API 키 및 Reddit API의 암호 임) 오류로 인해 오류가 발생했습니다. 스크립트에서

당신은 같은 것을 할 수 :

r.set_oauth_app_info(client_id='stJlUSUbPQe5lQ', 
...      client_secret='DoNotSHAREWithANYBODY', 
...      redirect_uri='http://127.0.0.1:65010/' 
...         'authorize_callback') 

https://praw.readthedocs.io/en/stable/pages/oauth.html?highlight=client_id#step-2-setting-up-praw

을 또는 아래 링크에 설명 된대로 praw.ini 파일에 설정 :

https://praw.readthedocs.io/en/stable/pages/configuration_files.html#configuration-variables

당신이 만약 reddit API에 대한 액세스 권한을 이미 신청 한 경우 다음과 같이 표시됩니다.

https://www.reddit.com/wiki/api

OAuth 클라이언트 ID (들) *

  • 아직없는 경우,받을 때 [email protected] 이메일을 보내거나 추가 할 때하시기 바랍니다 추가

https://www.reddit.com/prefs/apps

에서 client_id을 얻을 수 있습니다. 자신의 문서에서 (API를 응용 프로그램의 제목 아래)이 예에서

enter image description here

0 : client_id=p-jcoLKBynTLew

+0

내 R은 따라서 설정되어 있지 않은 나는 그것을 사용할 수 없습니다. 'r = praw.Reddit (user_agent ='사용자 정의 데이터 마이닝 프레임 워크 ', ... site_name ='lamiastella ')'에 오류가 있습니다. 여기서 r이 지정됩니다! 이 질문을 통해 client_id를 정확히 찾을 수있는 방법과 praw.ini를 설정하는 방법을 확인했습니다. –

+1

어디에서 'client_id'를 찾을 수 있는지 업데이트했습니다. – ode2k

+0

감사합니다. 그것은 나에게 client_id가 어디에 있는지 분명히했다. –

관련 문제