|ImportError: No module named ipdb||Sepero||1/27/13 8:51 AM|
ImportError: No module named ipdb
I get this error when trying to use ipdb. It imports without any problems when using: python manage.py shell.
The interactive shell shows this location of ipdb:
In : ipdb.__file__
So I tried putting that in sys.path() before importing.
Unfortunately, it still gives the import error. Thoughts on what I might be doing wrong?
|Re: ImportError: No module named ipdb||D X||1/27/13 8:53 PM|
On GAE the only available libs are the ones provided in the GAE SDK or the ones your in your project folder. You'll have to put it in your project folder.
Or just use pdb.
|Re: ImportError: No module named ipdb||Sepero||1/28/13 5:14 AM|
Thanks DX. My apologies if this is a dumb follow up question. Where in the project folder would you put it? And how would you do it? (manually copy the files, or use something like pip?) What command?
|Re: ImportError: No module named ipdb||D X||1/28/13 8:31 AM|
You would manually copy the entire folder over.
You' must have already done this with the "django" folder, so follow that pattern.
This is something you'll need to do with any library you're including in your GAE project.
This still begs the question, why are you using ipdb instead of pdb?
If you're using ipdb because you're using ironpython, I'm curious why.
|Re: ImportError: No module named ipdb||Sepero||1/28/13 8:40 AM|
The reason I'd rather use ipdb is for readline capabilities. Regular pdb doesn't seem to support tab completion, and command history.
|Re: ImportError: No module named ipdb||Sepero||1/28/13 3:24 PM|
Trying to get ipdb into gae failed for me, because it requires import of a file resource.so (and I couldn't figure out how to allow that). When using pdb, do you have access to (up/down) history and tab completion? I was just assuming it doesn't work for anyone. Maybe I'm missing something?
|Re: ImportError: No module named ipdb||D X||1/29/13 8:06 AM|
I suspect the .so file is native code library of some sort. If it is, app engine won't allow it.
pdb does have access to up/down history. It doesn't have tab completion. However, I just googled it and it looks like you can put it in yourself (haven't actually tried this)
That being said, I have some issues with how my shell interacts with pdb that I haven't figured out. When I run "python manage.py runserver", my pdb shell's key mappings to up/down/backspace are screwed up. However, in "python manage.py test", they work fine. I'm sure it's solvable, but so far I haven't gotten around to trying to figure out the problem.
|Re: ImportError: No module named ipdb||Sepero||1/29/13 1:48 PM|
It's funny you mention that link, because I had just found it earlier myself. Unfortunately, the tab completion doesn't seem to work in gae either.
I may be having the same screwed up keymappings as you, because when I press up/down, it just prints characters like [^A. Until someone can figure this out, it currently looks like a debugging dead end.
|Re: ImportError: No module named ipdb||D X||1/30/13 6:38 PM|
Let me know if you figure it out, I'd love a fix too.
The up/down has been a minor annoyance. The backspace though, is a huge hindrance. I've had times where I type my command somewhere else and cut and paste (or scroll up into history and cut and paste). But I guess it's probably worthwhile to figure a way to hack around it.
|Re: ImportError: No module named ipdb||D X||1/30/13 10:14 PM|
So I spent 3 hours on this :P
I haven't completely figured out why, but a big part of the problem is that the readline library is native, and excluded from the python runtime.
You can work around the up/down keys by running
'rlwrap python manage.py runserver' (assuming you're on linux/osx)
but I couldn't get the tab completion working.
(pulled the rlwrap hint from the GAE issues tracker http://code.google.com/p/googleappengine/issues/detail?id=308)
|Re: ImportError: No module named ipdb||Sepero||1/31/13 12:23 AM|
Of course I'm on Linux! lol
Thanks for the tip about rlwrap. Definitely a lot better this way. At least now if I make a typo, I can go back and correct it. :)