SublimeText / LaTeXTools

LaTeX plugin for Sublime Text
https://latextools.readthedocs.io/
2.01k stars 366 forks source link

Problem with ctypes and ST2 #5

Closed dan-blanchard closed 12 years ago

dan-blanchard commented 13 years ago

I get the following error in my console when trying to use your plugin:

Traceback (most recent call last): File "./sublime_plugin.py", line 57, in reload_plugin File "./DDEExecute.py", line 2, in from ctypes import * File ".\ctypesinit.py", line 10, in ImportError: No module named _ctypes

I'm not sure if this is a ST2 issue or a LaTeXTools problem, but I thought I'd let you know. Thanks for all your hard work!

msiniscalchi commented 13 years ago

What version of ST2 and Windows are you using? This should not be happening---I wonder if anything changed in recent builds. I cannot test on Windows for another couple of weeks, but maybe i can trace the problem with your help.

On Fri, Aug 12, 2011 at 6:10 PM, dan-blanchard reply@reply.github.com wrote:

I get the following error in my console when trying to use your plugin:

Traceback (most recent call last):  File "./sublime_plugin.py", line 57, in reload_plugin  File "./DDEExecute.py", line 2, in    from ctypes import *  File ".\ctypesinit.py", line 10, in ImportError: No module named _ctypes

I'm not sure if this is a ST2 issue or a LaTeXTools problem, but I thought I'd let you know. Thanks for all your hard work!

Reply to this email directly or view it on GitHub: https://github.com/SublimeText/LaTeXTools/issues/5

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

dan-blanchard commented 13 years ago

I was actually using ST2 build 2101 on Ubuntu, so I don't know if that was the cause of the problem. I have ctypes installed, and the version of Python 2.6 bundled ST2 comes with everything your plugin needs anyway, right?

msiniscalchi commented 13 years ago

Aah... unfortunately, Ubuntu is not supported at the moment. It's a bit puzzling that importing ctypes should fail, but even if that worked, the DDE stuff obviously won't work as it is Windows-related.

Sorry I can't help with Ubuntu right now... I may have some time to play with things in a couple of weeks, but I can't promise anything. OTOH, if you feel like helping out, that would be terrific, and I'd be thrilled to help you with suggestions, clarifications, etc...

On Mon, Aug 15, 2011 at 1:37 AM, dan-blanchard reply@reply.github.com wrote:

I was actually using ST2 build 2101 on Ubuntu, so I don't know if that was the cause of the problem. I have ctypes installed, and the version of Python 2.6 bundled ST2 comes with everything your plugin needs anyway, right?

Reply to this email directly or view it on GitHub: https://github.com/SublimeText/LaTeXTools/issues/5#issuecomment-1803863

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

dan-blanchard commented 13 years ago

I may be able to squeeze in some time to help with the Ubuntu version, but I'm very new to ST2 plugins.

Anyway, I thought you had the Mac version working? If the Mac version uses texlive, why wouldn't that also work on Linux?

msiniscalchi commented 13 years ago

You are right as far as tex & friends are concerned. However, there are different PDF viewers on Linux and Mac. Supporting forward and inverse search requires platform- and indeed viewer-specific code...

On Wed, Aug 24, 2011 at 12:36 PM, dan-blanchard reply@reply.github.com wrote:

I may be able to squeeze in some time to help with the Ubuntu version, but I'm very new to ST2 plugins.

Anyway, I thought you had the Mac version working? If the Mac version uses texlive, why wouldn't that also work on Linux?

Reply to this email directly or view it on GitHub: https://github.com/SublimeText/LaTeXTools/issues/5#issuecomment-1892201

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

dozed commented 13 years ago

A pragmatic approach would be to remove the "ctypes" import, which actually allows to load the plugin. See here: https://github.com/dozed/LaTeXTools/commit/ef86e7586f283bbd9adb9834662bfb0d6ac9af95#L1L0 But this breaks the windows version.

Does Sublime ship with its own python libraries? Maybe we are facing a problem with the included libs.

msiniscalchi commented 13 years ago

ctypes is essential on Windows---otherwise I cannot invoke DDE commands.

Yes, ST2 does ship with its own Python libraries. Again, I haven't had the time to look at ST2 on Linux. I guess maybe one possibility would be to import ctypes only if the platform is windows.

On Sat, Oct 8, 2011 at 11:06 AM, Stefan Ollinger reply@reply.github.com wrote:

A pragmatic approach would be to remove the "ctypes" import, which actually allows to load the plugin. See here: https://github.com/dozed/LaTeXTools/commit/ef86e7586f283bbd9adb9834662bfb0d6ac9af95#L1L0 But this breaks the windows version.

Does Sublime ship with its own python libraries? Maybe we are facing a problem with the included libs.

Reply to this email directly or view it on GitHub: https://github.com/SublimeText/LaTeXTools/issues/5#issuecomment-2332650

Marciano Siniscalchi Economics Department, Northwestern University http://faculty.wcas.northwestern.edu/~msi661

dozed commented 13 years ago

Ok, sounds good. I re-added the import, it is now only reachable if ST2 is run under a Windows platform. Could you test the Package under Windows and OSX?

https://github.com/SublimeText/LaTeXTools/pull/6

dozed commented 13 years ago

There is already a working version of LatexTools for linux: https://github.com/csrg/LaTeXTools Did miss it somehow =)

The author added some more features, so it would be nice to merge it from there maybe...

msiniscalchi commented 13 years ago

I'll take a look... I have very little time these days, but I did install a Ubuntu VM so at least I can experiment.

msiniscalchi commented 12 years ago

there is a duplicate issue for this, so I'm closing this one.