Sublime Forum

Startup Error: No module named __future__

#1

I’m trying to run Sublime Text 2 on crashbang linux (based on Debian 6). When it starts up a dialog pops up with the following:

[quote]Unable to run package setup:

Failed to load module

Traceback (most recent call last):
File “./PackageSetup.py”, line 3, in
from future import with_statement
ImportError: No module named future[/quote]

If I remove the future import statement from PackageSetup.py the next import statement (‘import glob’) fails.
The following is printed out in the console:

[quote]libgio version is less than 2.26, single instance support disabled
‘import site’ failed; use -v for traceback
[/quote]

I saw a thread with the same error from some time back (2008) which was fixed, although the source of the problem was never given.

0 Likes

#2

I am having the same issue on Mac OS X Lion.
You can take a look at the screenshot of the error here: skitch.com/caruso_g/8d1n8/sublime-text-2
I checked my Python installation. It is 2.7.2
Following is the output of a little test I made in Terminal.app

[code]Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 15:22:34)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type “help”, “copyright”, “credits” or “license” for more information.

from future import with_statement
import glob[/code]

Any idea? I was really curious to try ST2, but with this incipit, I find it difficult.

0 Likes

#3

I’m having this error on OS X Lion as well. It happened after I upgraded to build 2181.

0 Likes

#4

This bug is caused by Sublime Text not detecting the path to the core Python libs its scripts depend on. You can workaround this by copying all those libs into the root folder of Sublime Text. Typically you’ll find them in the /usr/lib/python2.6 or /usr/lib/python on the *nix systems (MacOS X too). Also you’ll find them zipped in the “/lib/python26.zip” but this doesn’t work always.

0 Likes

#5

Thanks for the response, but where exactly is the root folder of ST2? I assume you don’t mean the Package Contents of it in Applications? Also, would I just copy the python directory itself into the root, or just the contents within?

0 Likes

#6

I am getting the same error in OSX Lion using the stable, dev, and nightly builds. No amount of copying the python 2.6 or 2.7 folder or their files anywhere near or within the package contents helps.

This is the text of the error pop-up one more time:

**Unable to run package setup:

Failed to load module

Traceback (most recent call last):
File “PackageSetup.py”, line 3, in
from future import with_statement
ImportError: No module named future**

Anybody get this working?

0 Likes

#7

I am having the same problem with Mac OS X 10.7.5 I keep getting the following:

"Unable to run package setup:

Failed to load module

Traceback (most recent call last):
File “./PackageSetup.py”, line 4, in
import glob
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/glob.py”, line 4, in
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/os.py”, line 49, in
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py”, line 16, in
File “/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/warnings.py”, line 8, in
ImportError: No module named types"

My pop-up seems to be just a bit different. Any help would be greatly appreciated.

Thanks

0 Likes

#8

Ok, apparently Python 2.7 is broken in OS X 10.7. Here is what I had to do to get Sublime Text 2 to run.

Download Xcode (It’s free through the Apple Store)
Once downloaded and installed, go to Preferences within Xcode;
Click on Downloads at the top;
Install Command Line Tools.

After it finished installing, I reinstalled Sublime Text 2 and it magically worked.

Hope this helps.

Good luck!

0 Likes

#9

Again I’ve bumped into this issue. Now with Ubuntu 12.10 64bit. Fortunately after hours of hairpulling I found a solution and posted it here.

0 Likes