## Unable to run Sublime2 on install Windows 7

### Unable to run Sublime2 on install Windows 7

I am getting an error about a weak reference to 'classobj' object after installing the X64 version of the latest sublime 2 texteditor (2182).

My python path is K:\Toolchains\Windows7\X64\sig1\Python-2.7.1\...

Do I need to point it to the python directory in the install path? Is there anyway python 2.7 and 2.6 can co-exist on the same windows box and have this run? It seems like if there is an extern dependency explicitly on python 2.6, we would at least have the option to compile or install this application against another targeted version.

Error is:

Unable to run package setup

Failed to load module

Traceback (most recent call last):
File ".\PacketSetup.py", line 4, in <module>
import glob
File ".\glob.py", line 4, in <module>
File ".\os.py", line 398, in <module>
File ".\UserDict.py", line 83, in <module>
File "K:\Toolchains\Windows7\X64\sig1\Python-2.7.1\Lib\abc.py", line 109, in register
if issubclass(subclass, cls):
File "K:\toolchains\Windows7\X64\sig1\Python=2.7.1\Lib\abc.py", line
151, in __subclasscheck__
if subclass in cls.__abc_cache:
File
"K:\Toolchain\Windows7\X64\sig1\Python-2.7.1\Lib\_weakrefset.py",
line 69, in __contains__
return ref(item) in self.data
TypeError: cannot create weak reference to 'classobj' object
silentmobius

Posts: 2
Joined: Tue Mar 06, 2012 2:52 pm

### Re: Unable to run Sublime2 on install Windows 7

Sublime has it's own python, used for the plugins.

And yes, ST2 has no problems to coexist with any installed python. I'm running ST2, python 2.7 and 3.2 on W7-64.
Seems like it's a 3rd party package problem.
Do you have problems with a plain installation of ST2?
mbajohr

Posts: 16
Joined: Mon Aug 29, 2011 12:16 pm

### Re: Unable to run Sublime2 on install Windows 7

I was having the same problem, running python 2.7.1

When run from the desktop launcher, I saw this:

My PYTHONPATH:
Code: Select all
C:\opt\win\python27\Lib;C:\opt\win\python27\Lib\site-packages;C:\opt\win\python27\DLLs;C:\opt\win\python27\lib\plat-win;C:\opt\win\python27\lib\lib-tk;

abc.py does exist in the Lib directory, but research tells me that for 2.x python, abc is supposed to be a builtin.

I renamed all the modules:
Code: Select all
__test__abc.py__test__abc.pyc__test__abc.pyo

And reran the executable on the menu, and everything WORKED!
Last edited by gmgauthier on Wed Mar 07, 2012 5:58 pm, edited 1 time in total.
gmgauthier

Posts: 4
Joined: Thu Mar 01, 2012 3:13 pm

### Re: Unable to run Sublime2 on install Windows 7

getting rid of my goofy PYTHONPATH environment variable also worked fine for me. I noticed on my home pc I don't even have this defined and can run python scripts fine.
silentmobius

Posts: 2
Joined: Tue Mar 06, 2012 2:52 pm

### Re: Unable to run Sublime2 on install Windows 7

silentmobius wrote:getting rid of my goofy PYTHONPATH environment variable also worked fine for me. I noticed on my home pc I don't even have this defined and can run python scripts fine.

Well, some of us need to maintain a PYTHONPATH for various reasons...
gmgauthier

Posts: 4
Joined: Thu Mar 01, 2012 3:13 pm

### Re: Unable to run Sublime2 on install Windows 7

For those who do need to maintain a regular PYTHONPATH at the system level, here's a little batch command to eliminate the problem of the abc.py module, without having to rename abc.py, or mess up your normal python command-line console:

Code: Select all
@ECHO OFFSET "PYTHONPATH=.;C:\path\to\your\sublime;C:\path\to\your\sublime\python26;"start /B sublime_text.exe %*exit

I unzipped the "python26.zip" in the installation directory, which is why the extra directory is on my path.

Anyway, put this batch in a file called something like "start_sublime.cmd" in your sublime installation directory, and then create a shortcut to that batch file on your desktop or wherever. It sets the python path for sublime temporarily to allow it to pull whatever it needs from the python26 libraries, but leaves your general system setting alone.

Hope this helps.
gmgauthier

Posts: 4
Joined: Thu Mar 01, 2012 3:13 pm

Return to Technical Support

### Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 7 guests