Sublime Forum

64-bit python error on application open

#1

Hi there!

I really want to try out your Sublime Text 2 editor, but I it seems that I cannot get it to work. I know its a beta version, but I want to try out the new stuff :smile:

As you can see, in the test below, I am running python 2.6 64-bit, so I don’t understand why I get this failure, see error message below. I have tried to prefer python 32-bit and then launching the application again, but the error remains. Finally I tried to run the following without getting any errors:

python /Applications/Sublime\ Text\ 2.app/Contents/MacOS/PackageSetup.py

So I think the problem is how do I set my system to run applications with python in 64-bit?

My OS: Mac OSX 10.6.8

Test:

usr$ python
Python 2.6.7 (r267:88850, Nov 16 2011, 09:41:02) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform, sys
>>> platform.architecture()
('64bit', '')

Error message:

Unable to run package setup:

Failed to load module

Traceback (most recent call last):
  File "./PackageSetup.py", line 7, in <module>
    import zipfile
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/zipfile.py", line 4, in <module>
    import struct, os, time, sys, shutil
  File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/struct.py", line 1, in <module>
    from _struct import *
ImportError: /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_struct.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode)
0 Likes

#2

Have you modified your system version of Python? Try running this, and check you get the same output:

$ file /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_struct.so
/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/lib-dynload/_struct.so: Mach-O fat file with 2 architectures
0 Likes