Home Download Buy Blog Forum Support

Startup Error: No module named __future__

Startup Error: No module named __future__

Postby ruhlio on Mon Jan 16, 2012 11:20 pm

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:
Unable to run package setup:

Failed to load module

Traceback (most recent call last):
File "./PackageSetup.py", line 3, in <module>
from __future__ import with_statement
ImportError: No module named __future__

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:
libgio version is less than 2.26, single instance support disabled
'import site' failed; use -v for traceback


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.
ruhlio
 
Posts: 1
Joined: Mon Jan 16, 2012 11:15 pm

Re: Startup Error: No module named __future__

Postby caruso_g on Tue Feb 21, 2012 8:17 pm

I am having the same issue on Mac OS X Lion.
You can take a look at the screenshot of the error here: https://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: Select all
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


Any idea? I was really curious to try ST2, but with this incipit, I find it difficult.
caruso_g
 
Posts: 1
Joined: Tue Feb 21, 2012 8:13 pm

Re: Startup Error: No module named __future__

Postby johlin on Wed Feb 22, 2012 4:21 pm

I'm having this error on OS X Lion as well. It happened after I upgraded to build 2181.
johlin
 
Posts: 2
Joined: Wed Feb 22, 2012 4:19 pm

Re: Startup Error: No module named __future__

Postby NukasuKanaka on Tue Apr 17, 2012 10:28 am

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 "<Sublime Text>/lib/python26.zip" but this doesn't work always.
NukasuKanaka
 
Posts: 3
Joined: Fri Apr 06, 2012 4:40 am

Re: Startup Error: No module named __future__

Postby johlin on Thu May 03, 2012 10:16 pm

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?
johlin
 
Posts: 2
Joined: Wed Feb 22, 2012 4:19 pm

Re: Startup Error: No module named __future__

Postby tbq on Sun Jun 24, 2012 5:30 pm

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 <module>
from __future__ import with_statement
ImportError: No module named __future__


Anybody get this working?
tbq
 
Posts: 1
Joined: Sun Jun 24, 2012 5:20 pm

Re: Startup Error: No module named __future__

Postby beth on Sun Oct 21, 2012 7:21 pm

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 <module>
import glob
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/glob.py", line 4, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/os.py", line 49, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/posixpath.py", line 16, in <module>
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/warnings.py", line 8, in <module>
ImportError: No module named types"

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

Thanks
beth
 
Posts: 2
Joined: Sun Oct 21, 2012 7:13 pm

Re: Startup Error: No module named __future__

Postby beth on Tue Oct 23, 2012 3:57 am

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!
beth
 
Posts: 2
Joined: Sun Oct 21, 2012 7:13 pm

Re: Startup Error: No module named __future__

Postby NukasuKanaka on Thu Nov 29, 2012 11:10 pm

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.
NukasuKanaka
 
Posts: 3
Joined: Fri Apr 06, 2012 4:40 am


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 17 guests