Sublime Forum

Just can't seem to install a package

#1

Hello all, I’m having some trouble trying to install any packages with package control.

I have a registered license and I use SublimeText 3 for work. I use it on an enterprise server pool that I do NOT have any super user permissions on. I download the binary tar ball from the download page and run it out of a folder.

Info:
SublimeText 3 Version 3.1.1 Build 3176
RedHat enterprise workstation 6.4
Kernel 2.6.32-754.14.2.el6.x86_64

Problem:
Now all I have really been trying to do is install packages using package control. I know it worked at one point but I haven’t needed to install any in a while. Basically when I use CTRL+SHIFT+P and use Package Control: Install Package, the loading bar at the bottom goes for a bit, but fails out and I can’t load any packages.

Console Output: (I replaced my absolute path with /home/user/, I run sublimetext out of /home/user/bin)

    Exception in thread Thread-5:
    Traceback (most recent call last):

      File "./python3.3/threading.py", line 901, in _bootstrap_inner
      File "/home/user/.config/sublime-text-3/Installed Packages/Package Control.sublime-package/package_control/commands/install_package_command.py", line 45, in run
        self.package_list = self.make_package_list(['upgrade', 'downgrade', 'reinstall', 'pull', 'none'])
      File "/home/user/.config/sublime-text-3/Installed Packages/Package Control.sublime-package/package_control/package_installer.py", line 91, in make_package_list
        if self.manager.is_vcs_package(package):
      File "/home/user/.config/sublime-text-3/Installed Packages/Package Control.sublime-package/package_control/package_manager.py", line 310, in is_vcs_package
        return self._is_git_package(package) or self._is_hg_package(package)
      File "/home/user/.config/sublime-text-3/Installed Packages/Package Control.sublime-package/package_control/package_manager.py", line 285, in _is_git_package
        return os.path.exists(git_dir) and (os.path.isdir(git_dir) or os.path.isfile(git_dir))
      File "./python3.3/genericpath.py", line 18, in exists
    UnicodeEncodeError: 'latin-1' codec can't encode character '\u2013' in position 73: ordinal not in range(256)

My guess is it’s somehow not handling the ‘-’ in the Package Control path for some reason, but I can’t explain why, maybe an underlying OS issue.

I have also looked for a way to install packages manually but I haven’t found a decent/official looking guide that doesn’t refer to package control. I didn’t spend a long time looking though as I’d rather fix package control.

I also tried to reinstall the latest version of sublimetext (build 3207), but when I try to start it fails saying

Unable to load libgdk-3.so
Unable to load libgtk-3.so

There’s a whole lot of other garbage in there too, but that’s just caused by missing those libraries. Google says it’s most likely I’m trying run a 32-bit version on a 64-bit OS but I know I’ve downloaded the right one.

Any help would be very much appreciated in debugging this!

0 Likes

#2

The latest versions of Sublime require GTK 3, which I don’t believe RHEL 6 supports.

I wonder if the other issue is related to the OS locale?

1 Like

#3

Indeed the first issue is most likely related to the locale not being UTF-8; Package Control does checks to see if packages exist and there is a package in the package repository that uses a non-ascii dash character, which triggers this problem.

There’s more information in this post:

2 Likes

#4

WooHoo! The locale was the issue, thanks for the help guys.

If anyone else doesn’t have the permissions to change the system local, simply changing the environment variable fixed the issue for me.

setenv LANG "en_US.UTF-8"

As for upgrading to the latest version I’ll just have to wait until my sysadmins get us upgraded.

I do have another interesting query as long as I’ve got this thread going. (Attempting to avoid opening multiple)

As I mentioned I work out of a server pool, and when I request a machine my license disappears and says UNREGISTERED again. I don’t mind entering the license each time as it only occurs when getting a new machine.

But I’m wondering how the license information is stored or where it could be getting cached that gets lost. I don’t know much about how the machine allocation works, nor do I think I should share too many details, so sorry I can’t provide more information on how that works.

Since this is related to licensing I understand if I should be left in the dark for that issue.

0 Likes

#5

The license information is stored in the file DATA/Local/License.sublime_license, where DATA is an OS specific location; for Linux it’s ~/.config/sublime-text-3, but you can always use Preferences: Browse Packages and go up one folder level to find it, regardless of what OS you’re using. It’s also referenced in the documentation for reverting to a fresh state.

If your home directory is reset somehow when you request a new machine (e.g. it’s stored on the machine and doesn’t follow you from machine to machine), then you’d likely find that the license file is missing, Sublime assumes that it’s not licensed and you have to enter the license again.

If the license file is present there, then your issue is that when you enter your license information in the license dialog, Sublime encodes it with the machine ID and writes a binary version of it to the license file to prevent accidental leaks (say if you keep your home directory in a git repository or such).

Thus every time you get a new machine from the pool, the machine ID is different and the license isn’t valid.

You can resolve that issue by manually removing the License file and replacing it with an identically named file that contains your license information as you would paste it into the License dialog in textual form. Sublime will use the plain text version of the license the same as the binary one, but it’s not machine specific so it should work everywhere in that case.

0 Likes