Sublime Forum

Unable to run package setup

#1

I am running Sublime Text 2 (Build 2144) on Lubuntu 11.10 and, since yesterday, I am getting the following error every time I try to start Sublime Text…

[quote]Unable to run package setup:

Traceback (most recent call last):
File “./PackageSetup.py”, line 155, in upgrade
upgradePackage(pkg, pristinedir, datadir, backupdir)
File “./PackageSetup.py”, line 148, in upgradePackage
os.path.join(backupdir, base), inhibitOverwrite)
File “./PackageSetup.py”, line 31, in upgradeArchive
newar = zipfile.ZipFile(src)
File “.\zipfile.py”, line 696, in init
File “.\zipfile.py”, line 716, in _GetContents
File “.\zipfile.py”, line 728, in _RealGetContents
zipfile.BadZipfile: File is not a zip file[/quote]

Is there any fix for this?

0 Likes

#2

I have the same problem on Windows 7 64 Bit with the same version and it started yesterday as well. I will send the author an e-mail and ask him to look at this post.

0 Likes

#3

[quote=“kristallizer”]I am running Sublime Text 2 (Build 2144) on Lubuntu 11.10 and, since yesterday, I am getting the following error every time I try to start Sublime Text…

[quote]Unable to run package setup:

Traceback (most recent call last):
File “./PackageSetup.py”, line 155, in upgrade
upgradePackage(pkg, pristinedir, datadir, backupdir)
File “./PackageSetup.py”, line 148, in upgradePackage
os.path.join(backupdir, base), inhibitOverwrite)
File “./PackageSetup.py”, line 31, in upgradeArchive
newar = zipfile.ZipFile(src)
File “.\zipfile.py”, line 696, in init
File “.\zipfile.py”, line 716, in _GetContents
File “.\zipfile.py”, line 728, in _RealGetContents
zipfile.BadZipfile: File is not a zip file[/quote]

Is there any fix for this?[/quote]

I resolved this by doing the following:

  1. You can follow this guide to revert to a fresh install of your profile: sublimetext.com/docs/2/revert.html.
  2. Install package control in the console by pressing CTRL+` and then paste the following into the console:
import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())
  1. Re-install all the packages that you had installed
  2. Copy all the files from Packages/User to your new profile directory Packages/User
  3. Copy all the files from Settings/ to your new profile directory Settings/
  4. Restart Sublime Text 2 everything should be back to normal again!
0 Likes

#4

This error means there is a bad zip file, most likely in your Installed Packages directory. You shouldn’t need to do a full wipe to fix it. Instead, go to your Sublime data directory (C:\Users{username}\AppData\Roaming\Sublime Text 2\ on Windows, /Users/{username}/Library/Application Support/Sublime Text 2/ on OSX and /home/{username}/.config/sublime-text-2/ on Linux). Then browse to the Installed Packages directory. If there are any zip files in there, delete it.

Please let me know what package file is causing this for you. If this does not fix it for you, let me know.

0 Likes

Package Control: A full-featured package manager
Package Control: A full-featured package manager
#5

I just ran into this issue and couldn’t find any zip files in my Packages directory. But I noticed that there was a directory that was empty (Sublime CodeIntel) so I deleted it. Ran Sublime and the directory was created again. I checked around and found a file in my “Installed Packages” directory called “SublimeCodeIntel.sublime-package”. I deleted that file and Sublime is now happy again.

0 Likes

#6

[quote=“wbond”]This error means there is a bad zip file, most likely in your Installed Packages directory. You shouldn’t need to do a full wipe to fix it. Instead, go to your Sublime data directory (C:\Users{username}\AppData\Roaming\Sublime Text 2\ on Windows, /Users/{username}/Library/Application Support/Sublime Text 2/ on OSX and /home/{username}/.config/sublime-text-2/ on Linux). Then browse to the Installed Packages directory. If there are any zip files in there, delete it.

Please let me know what package file is causing this for you. If this does not fix it for you, let me know.[/quote]

Apologies for the late reply, wbond. There were two zip files in the directory you pointed to; Sublime Text 2 came back to normal after I deleted them both. Unfortunately, though, I forgot to note down which package files were causing the problem. I will be sure to let you know if this problem comes back again.

Thanks a ton for your help.

0 Likes

#7

Hi there, thanks to wbond and lencioni, I had the same issue, in my case I had “Sass.sublime-package” file in my “Installed Packages” directory, once disabled, ST2 was working perfectly.
FYI, I m on a portable version of ST2.

Thanks Guys, I can start to work correctly again.

0 Likes

#8

There was only one .package file there for me (plain tasks). Deleting it fixed the issue. Thanks!

0 Likes

#9

I can also confirm that this works.

0 Likes

#10

i’m unable solve this problem. i’m getting it after i upgraded my OS X to yosemite

0 Likes