2009-06-23 4 views
4

localhost에서 간단한 "Hello World"Google App Engine 애플리케이션을 문제없이 실행할 수 있습니다. 그러나 "import gdata.auth"라는 줄을 파이썬 스크립트에 추가하면 "ImportError : No module gdata.auth"가됩니다.Google App Engine에서 gdata 모듈을 찾을 수 없습니다.

나는 GDATA 모듈을 설치하고 내 .bashrc에 다음 줄을 추가 : 내가 할 필요가 무엇을

export PYTHONPATH=$PYTHONPATH:/Library/Python/2.5/site-packages/

있습니까? 감사.

EDIT : 이상한 점은 쉘에서 python을 실행하고 "import gdata.auth"를 입력하면 오류가 발생하지 않는다는 것입니다. 스크립트에이 추가

답변

9

귀하의 .bashrc가 구글 앱 엔진에 알려져 있지 않다. gdata 디렉토리 (모든 적절한 내용 포함)가 응용 프로그램의 기본 디렉토리 아래에 있는지 확인하십시오!

특히 this article을 참조하십시오 (나는 인용) :

To use this library with your Google App Engine application, simply place the library source files in your application's directory, and import them as you usually would. The source directories you need to upload with your application code are src/gdata and src/atom. Then, be sure to call the gdata.alt.appengine.run_on_appengine function on each instance of a gdata.service.GDataService object. There's nothing more to it than that!

+0

이것은 나에게 다른 주를 일하게하는 방법이다. 코드를 gdata 디렉토리에 업로드하면 정렬되어야한다. – Kinlan

0

시도 :

import sys 
sys.path.append('<directory where gdata.auth module is saved>') 
import gdata.auth 
+0

여전히 같은 오류가 발생합니다. 그래도 고마워. – titaniumdecoy

+0

아니요. 아프다는 생각이 들지 않습니다. 질문에 대답하지 않았기 때문에 투표를 끝 냈습니다. – Kinlan

1

GDATA 클라이언트 라이브러리 설치 스크립트는 우분투 파이썬 설치에 대한 잘못된 디렉토리에 모듈을 설치합니다.

sudo mv /usr/local/lib/python2.6/dist-packages/* /usr/lib/python2.6/dist-packages