Closed tummychow closed 10 years ago
Some more notes:
This occurs out-of-the-box with the sublime text 64-bit tarball (ie with no custom python I still encounter this error on arch linux), and the error text is exactly the same.
I also have lib-dynload in my custom python; specifying the path to it in SDC's settings file does not affect the error.
Sorry if this is not really clear, I'm not sure where to begin debugging so I'm just rebuilding and testing various pythons over and over. (I don't really speak python so I can't make any sense of the code.) Let me know if there is something specific you want to try.
Okay, so I kept experimenting and here is the environment where the plugin worked:
I'll close this since that seems to fix the problem, but there seems to be all kinds of weirdness about loading python into sublime, so if you want more information on my environment, let me know.
ST2 Linux support always needs some tweaking for this plugin. ST3 is much more reliable for plugins like this.
You shouldn't have to remove anything from init.py
. Just set "linux_python2.6_lib"
to an empty string in your settings file and then it won't import any unnecessary paths.
I get the same error with the empty string /shrug
I'd migrate to ST3 but I can't live without the C autocompletion, so for now I can live with the other issues of ST2.
That doesn't make sense. The code won't include a library path if the path does not exist. You would have to restart Sublime after the change.
linux_lib = load_settings().get("linux_python2.6_lib", "/usr/lib/python2.6/lib-dynload")
if not linux_lib in sys.path and exists(linux_lib):
sys.path.append(linux_lib)
You could try setting it something that doesn't exist /SomePathThatDoesNotExist
, but that shouldn't be required. os.path.exists("")
evaluates to False
.
If your okay with updating the plugin manually every time you sync up to the main branch, I guess that is fine. But I can't understand why removing the lines would be any different than setting the path to something that doesn't exist.
Now that I think about it, I am betting you didn't restart. As soon as you added back the line, it probably tried to import that folder. Then changing the setting wouldn't matter because the folder was already included. A restart is mandatory.
I don't speak Python, so I can't claim to understand the issue either. For what it's worth, I tried hacking at it in a few other ways beforehand, like this:
linux_lib = load_settings("linux_python2.6_lib", "/usr/lib/python2.6/lib-dynload")
if not linux_lib in sys.path and exists(linux_lib):
sys.path.append(linux_lib)
And then I got a new error, along the lines of sys
being an unknown identifier. If I removed the left side of the AND, like this:
linux_lib = load_settings("linux_python2.6_lib", "/usr/lib/python2.6/lib-dynload")
if exists(linux_lib):
sys.path.append(linux_lib)
Then I got an error about exists
being an unknown identifier.
I'm guessing there's something really wrong with my custom python, not with the code. I'm willing to hack at things to keep the ship afloat, but it's too bad I'm chained to it by SublimeClang.
And no, I restarted every time.
Cool. Well I tried :).
I am using SerializedDataConverter on Sublime Text 2 with Arch Linux (NOT ubuntu). Due to an issue with ctypes brought up by SublimeClang, I am not using the standard python2.6 packaged with sublime, but a custom build which fixes that issue. The build is using the instructions provided in that package's readme.
However, SerializedDataConverter does not work in this environment. I imagine the python is part of the problem. (Doesn't really help that Arch has problems building this archaic version of python because readline doesn't play nice with it.)
Here is the console content indicating the issue with loading the plugin:
What build settings do I need to apply for SDC to work correctly on a custom python?