Home Download Buy Blog Forum Support

Unable to run package setup

Unable to run package setup

Postby kristallizer on Wed Dec 07, 2011 3:23 am

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...

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


Is there any fix for this?
kristallizer
 
Posts: 3
Joined: Wed Dec 07, 2011 3:15 am

Re: Unable to run package setup

Postby octoquad on Wed Dec 07, 2011 9:16 am

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.
octoquad
 
Posts: 2
Joined: Wed Dec 07, 2011 9:14 am

Re: Unable to run package setup

Postby octoquad on Wed Dec 07, 2011 10:04 am

kristallizer wrote: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...

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


Is there any fix for this?


I resolved this by doing the following:

1. You can follow this guide to revert to a fresh install of your profile: http://www.sublimetext.com/docs/2/revert.html.
2. Install package control in the console by pressing CTRL+` and then paste the following into the console:
Code: Select all
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())

3. Re-install all the packages that you had installed
4. Copy all the files from Packages/User to your new profile directory Packages/User
5. Copy all the files from Settings/ to your new profile directory Settings/
6. Restart Sublime Text 2 everything should be back to normal again!
octoquad
 
Posts: 2
Joined: Wed Dec 07, 2011 9:14 am

Re: Unable to run package setup

Postby wbond on Wed Dec 07, 2011 12:02 pm

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.
wbond
 
Posts: 527
Joined: Mon Feb 28, 2011 5:33 am

Re: Unable to run package setup

Postby lencioni on Wed Dec 14, 2011 3:31 pm

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.
lencioni
 
Posts: 6
Joined: Thu Jul 08, 2010 3:32 pm

Re: Unable to run package setup

Postby kristallizer on Fri Dec 16, 2011 7:24 am

wbond wrote: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.


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.
kristallizer
 
Posts: 3
Joined: Wed Dec 07, 2011 3:15 am

Re: Unable to run package setup

Postby davask.42 on Sat Jan 19, 2013 6:26 am

by wbond on Wed Dec 07, 2011 12:02 pm - Please let me know what package file is causing this for you. If this does not fix it for you, let me know.

by lencioni on Wed Dec 14, 2011 3:31 pm - 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.

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.
davask.42
 
Posts: 1
Joined: Sat Jan 19, 2013 6:10 am

Re: Unable to run package setup

Postby skube on Mon Jun 24, 2013 2:47 pm

wbond wrote:.. Then browse to the Installed Packages directory. If there are any zip files in there, delete it.


There was only one .package file there for me (plain tasks). Deleting it fixed the issue. Thanks!
skube
 
Posts: 86
Joined: Tue Feb 28, 2012 8:42 pm

Re: Unable to run package setup

Postby wesf90 on Tue Jul 09, 2013 12:19 am

lencioni wrote: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.


I can also confirm that this works.
wesf90
 
Posts: 5
Joined: Sun Jul 15, 2012 12:39 am


Return to Technical Support

Who is online

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