Sublime Forum

Unable to run Sublime2 on install Windows 7

#1

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
import glob
File “.\glob.py”, line 4, in
File “.\os.py”, line 398, in
File “.\UserDict.py”, line 83, in
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

0 Likes

Menu items disabled
#2

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?

0 Likes

#3

I was having the same problem, running python 2.7.1

When run from the desktop launcher, I saw this:

My PYTHONPATH:

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:

__test__abc.py
__test__abc.pyc
__test__abc.pyo

And reran the executable on the menu, and everything WORKED! :smiley:

0 Likes

#4

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.

0 Likes

#5

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

0 Likes

#6

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:

@ECHO OFF SET "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.

0 Likes