开发者

Google App Engine Python ImportError Module Not Found

开发者 https://www.devze.com 2023-01-08 12:24 出处:网络
I\'m using Pydev 1.5.9 and the latest version of google app engine, developing in eclipse 3.6 I\'ve set up my environment, and I have my base code executing fine.

I'm using Pydev 1.5.9 and the latest version of google app engine, developing in eclipse 3.6

I've set up my environment, and I have my base code executing fine.

Now I'm trying 开发者_StackOverflowto import the simplejson library using import simplejson

I've tried

  1. adding the simplejson folder to a "pydev source folder" within eclipse
  2. tried adding simplejson folder as an external library
  3. tried adding simplejson in PYTHONPATH

I am still encountering an error when I attempt to run using SDK dev server. ' import simplejson

ImportError: No module named simplejson'

What is the best way to import external libraries into a Python App Engine project using Eclipse and Pydev?


Don't know if this will help with the Google App Engine, and may be too late, but the breadcrumb trail might help someone.

I had a similar problem in pydev and the solution was quite simple. Here is the pydev doc which talks about the subject of imports and configuring the interpreter in pydev.

The bit that I had missed, and caused a few hours of frustration, was that I had to press the Apply button in the Window > Preferences > PyDev > Interpreter - Python. This causes pydev to rebuild its internal indices and if you have added the libary into your PYTHONPATH somewhere (I just dropped it into the python/Lib folder) it should resolve your import problem - it did mine in any case.

Make sure you have automatic builds switched on for your project or rebuild your project if not.

HTH

0

精彩评论

暂无评论...
验证码 换一张
取 消