When I press Cmd-Shift-T (aka Open Type, which opens the Python: Globals Browser dialog), and type out a class I'd like to open, the browser finds the class just fine, but fails to actually open the file. Pressing Enter dismissed the dialog, but no file actually opens.
This worked just fine with Eclipse 3.4.0, but I've recently been testing out Eclipse 3.6 to see if my code shop could seamlessly upgrade, and this apparent bug is a serious showstopper.
My environment is:
Mac OSX 10.6.5
Eclipse Version: Helios Service Release 1, Build id: 20100917-0705 (Java EE package)
Pydev version: 220.127.116.110100513
After some additional poking around, I found the error log, which contains a stacktrace like this one for every time I tried to use the Globals Browser:
!ENTRY org.python.pydev.core 4 4 2010-11-19 14:15:26.172
!MESSAGE Unable to resolve module for:L/events/events/integration/ws/GetPerson.py
java.lang.RuntimeException: Unable to resolve module for:L/events/events/integration/ws/GetPerson.py
I don't know what that "L" is in the path to my GetPerson.py file, but maybe that's the problem?
Does this happen with all files? (can you try with some model from another project?) What seems to be happening in this case is that this particular file is not in your pythonpath (the L there is okay as that's the representation of the file within the eclipse workspace).
Can you try doing 2 things:
1. in your 'events' project, see if the source folder is properly set
2. If it is, at the same place your configure the pythonpath for the project (project > properties > pydev-pythonpath), click the 'force restore internal intfo' to see if that fixes the internal caches for the pythonpath in case there's some problem there.
If the error persists, please report back.
Force restore internal info did seem to have fixed that problem, but I think it may have been the cause of a much worse failure that showed up after the globals browser started working again. For some reason I could no longer import anything from any project besides my the local one. I double and triple checked the project dependencies, did a few more "force restore internal info" tests, and even tried updating to the newest nightly build of Pydev, but nothing worked.
The only way I managed to fix it was completely deleting my workspace and starting totally fresh. I think something must have gotten corrupted in my workspace metadata, because starting from scratch finally fixed all the problems I was having.
Humm, strange, but you mentioned you were coming from eclipse 3.4 to 3.6, so, updating the version + updating pydev could have something to do with pydev getting lost. I'll take a look here to see what could cause that (in the meanwhile, if you are able to replicate that somehow and pass me instructions on that, it'd probably be easier to fix it).
Unfortunately, I'm really not certain what actually caused the import failure to manifest, and I'm really too busy to play around with another copy of Eclipse to try to make it happen again. However, I'll try to be as specific as I can be about what I remember doing:
First, I installed Eclipse 3.6 into a different folder than my 3.4 install, because I didn't want to screw up my working dev env. Then I installed the plugins my code shop uses (Aptana Studio, Pydev, Subclipse, PDT), using the usual update sites. I then tweaked some of the Eclipse settings (keybindings mostly), but I didn't touch anything related to imports of PYTHONPATH.
After checking out all my projects through SVN, I realized that I needed to set up the default Python interpreter, so it set it to the MacPorts Python 2.5 install that my shop uses (the built-in Python on OSX is unsuitable for our projects). Then I started doing some dev work, and discovered the broken Globals Browser. I did several things to try and make it work, including updating to the newest nightly build (using www.pydev.org/nightly), but that didn't do anything. I *think* that using "Force restore internal info" on my project is what made the Globals Browser work, but that was when I also started getting import errors on everything outside of my project (and even things that were in the same project but under a different package tree than the erroring file).
It was at that point that I deleted my workspace folder and started fresh, and I didn't have any problems after that.
And thinking about that folder made me remember that at some point during that whole operation, I moved my workspace folder. I'd accidentally created it in ~/Documents/workspace-test instead of ~/dev/workspace-test). I remembered being screwed by Finder's total ignorance of .files, so instead of moving the contents of the folder, I moved the whole thing from ~/Documents to ~/dev. Maybe that's what messed it up? Something in Eclipse or Pydev may be saving absolute paths instead of workspace-relative paths.
Anyway, I hope my description helps you figure out this problem. I'd hate for anyone else to go through the same frustration I suffered.
So after a bit more use of Eclipse 3.6, I decided to stick with it and recommend the upgrade to my team. So, I moved my test workspace back to my normal workspace folder… and this globals browser bug popped up again. This also broke all my debugging, because Pydev can't figure out where my modules are. It really looks like there's something in Pydev that's improperly using absolute paths instead of workspace-local paths (or maybe saving the workspace path somewhere and not updating it when the workspace path changes?).
I'm getting that same exception as last time:
java.lang.RuntimeException: Unable to resolve module for:L/events/events/ui/action/home.py
That path is perfectly fine, but I'm guessing that the L is being interpreted as my old workspace path, rather than my new one.
Is there any safe way to force Pydev to update my workspace path? Last time I used the "Force restore internal info" button it didn't work.
OK, after a lot more tinkering, I fixed the problem. It looks like my issue was 2-fold:
1) Files that I had open in Eclipse before moving my workspace were re-opened after moving my workspace. They seemed to be opened just fine, but Eclipse was internally considering them to still be in my old workspace path. This was causing all kinds of internal havoc when trying to run my code. Closing and re-opening the files finally made them realize where they really were… but that didn't fix the failed import problem.
2) The failed imports I was getting when trying to run my code were because Pydev stores absolute paths internally, in files like "workspace/.metadata/.plugins/org.eclipse.core.resources/.projects/MY_PROJECT/com.python.pydev.analysis/AdditionalProjectInterpreterInfo.pydevinfo". Doing a "force restore internal info" on every single project in my workspace finally got rid of all the old absolute paths, and my project works again. It'd be nice if that wasn't necessary.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.