rosshadden / sublime-xpath

Sublime Text plugin for easier cursor navigation of XML and HTML files using XPath 1.0.
44 stars 10 forks source link

ImportError: dynamic module does not define init function (PyInit_etree) #44

Open BatD2 opened 4 years ago

BatD2 commented 4 years ago

Hi, I love the plugin and it is in fact extremely important for my work, as there is no better alternative in Sublime. I have installed work on Windows 10 laptop and facing the following error below with the plugin. The plugin installs, but not fully and the option to copy xpath is greyed out. All my other plugins seem to work fine.

File "C:\Users\*******\AppData\Roaming\Sublime Text 3\Installed Packages\xpath.sublime-package\xpath.py", line 4, in <module> ImportError: dynamic module does not define init function (PyInit_etree)

keith-hall commented 4 years ago

Thanks for the feedback, and sorry to hear you are having problems. That is not an error I have seen before, so please bear with me as my debugging is going to be mostly guesswork.

From what I can see, the plugin is unable to load the lxml Python dependency on your system. For reference, this dependency comes from https://github.com/eerohele/sublime-lxml. It hasn't had any updates recently, so that doesn't seem to be the problem.

Are you using a 64 bit build of Sublime Text? Which version are you using? Did you restart ST after installing this plugin? It may help to try that if you didn't already. Otherwise, it may help to go to the Tools menu -> Browse Packages, and delete the lxml folder, then run "Package Control: Satisfy Dependencies" from the ST Command Palette.

BatD2 commented 4 years ago

Thank you for the quick. response. I use the latest 64 bit Windows Version 3.2.2 build 3211. I have tried a few time re-installing the plugin, removing lxml, restarting after that, but still the same. To ease troubleshooting I removed all other plugins and reinstalled xpath. Please see full console output.

sublime_console_output.txt

keith-hall commented 4 years ago

Thanks for going through the trouble of trying with only xpath installed. I wonder if it's worth trying an older version of the lxml dependency - please try downloading the zip of https://github.com/eerohele/sublime-lxml/tree/e99456c8f4734a4cfac23fafb7f9557608b2f5fd, and extracting the contents into the Packages\lxml directory, overwriting what is there.

BatD2 commented 4 years ago

I tried testing it on other Windows 10 machines and it works ok. My guess is that they must set some security settings on my work laptop, which prevent Sublime from loading lxml. There is not much I can do about that, unfortunately. Thank you for your help.