Sublime Forum

Can't open files directly from Windows Explorer (ImportError

#1

If I double-click on a text file associated with SB2 in Windows Explorer, I always get this error:

[code]---------------------------
Sublime Text 2

Unable to run package setup:

Failed to load module

ImportError: No module named PackageSetup


OK

[/code]

I can open files fine by going through SB2’s file menu, or even by dragging the file over to the SB2 window and dropping it inside.

0 Likes

#2

I have exactly the same issue. I had this after installing 2.0.2 version of st2.

Details that may or may not have caused this:

  • My st2 2.0.1 was x86 and now I installed 64bit version of 2.0.2 (Old was in “Program files (x86)” and the new is now in “Program files” of course so the new didn’t replace the old one)
  • I noticed that my files still opens with st2 2.0.1 because assosiations point to that version of the program so…
  • I uninstalled 2.0.1 32bit version and then changed filetype associations in windows to point Sublime Text 2 64bit version
  • Now opening file – doubleclicking for example from desktop – leads to the same issue that was explained in the original post

I have tried to first start st2 as an Administrator. Didn’t help.
I removed my AppData/Roaming/Sublime Text 2 folder all together. Didn’t help.
My guess is that it’s not in anyway related with Roaming folder. Could it be in windows registry (something still pointing to wrong st2 PackageSetup?) or some sort of environmental issue?

0 Likes

#3

Writing the post was useful because it made me think and found the solution :smile:

My solution was this:

  1. Open regedit
  2. Find the text “Sublime Text 2”
  3. After a few F3 (next) pressing I found this key HKEY_USERS<here was some hash>\Software\Classes\Applications\sublime_text.exe\shell\open\command that was pointing to x86 version. I fixed the location and now everything works again.
0 Likes