[SOLVED] Did recent update "break" python (PS. No, not quite)

Sorry to do a kind of repeat but I’m of circling back around on my unresolved issue (Problems with TV Shows/Guide display after recent system update)

As near as my “noobish” head can tell, something in the recent system update (OSMC? Debian?) seems to have affected a python program to do an “import” command. The zap2xml.py file attempts to “import” …/script.module.mechanize/lib/mechanize and returns a “ImportError: No module named mechanize”. I checked path access using “cd” and that works fine. The mechanize folder contains a “_init_.py” file which should convert it to a module. This was all working very nicely before the update so it seems something has happened with the recent system update (~11/26/16) to break this part of the OSMC system.

If anyone has any idea what’s going, I’d appreciate it. Or, is there anyway to back out the most recent update(s) to try and get tings working again (without screwing up the system altogether…not that there’s any guarantee that would solve anything :frowning:

Desperate for a solution so any help is appreciated. If I can’t get this resolved in the next few days, I’ll have to use a different TV scraper, so any recommendations there are also appreciated.

Thanks in advance and cheers…

sudo apt-get install python-mechanize will do the trick.

But it’s not clear whether you are running this from Kodi or the shell. If it’s the shell you need to install the module in to the directory.


Appreciate it much for bearing with me. Thought I had everything set and then…

I believe it’s set up to run from Kodi (zap2xml, tv_grab_zap2xml), unless I’m missing something here. However, just to check out the issues I ran tv_grab_zap2xml (which calls zap2xml.py which tries to import mechanize) from the shell to see the results. Turns out they were the same :frowning:

If I don’t disable script.module.mechanize from within OSMC/Kodi, will that cause a problem in installing/using python-mechanize?

Also, any idea what went on that doing this install has fixed?

Thanks and cheers…

You need to resolve the dependencies yourself. You just need to make sure the packages are available under Kodi’s addons directory. Easier method is to get it working under shell and in site-packages, and then os.exec(python…) that way to get it to work under system Python.

What do you know about MechanicalSoup or BeautifulSoup or RoboBrowser? Can any of these be used in place of python-mechanize since python-mechanize has had no activity on it for a few years?

Don’t know anything about this. It’s probably beyond the scope of the OSMC forum, but maybe someone else can chime in

The addon script must have the library needed inside itself. For example if needs mechanize, if is written correctly, must have the correspondent lib inside the project or link another addon that have that library. This has nothing to do with pyhon installed on OSMC

@stephr1 As per the replies in your other thread on this topic here you will need to raise the issue either on the support thread for this add-on at Kodi Community Forum - Add-on Support or directly with the developer.

You will get a far quicker answer than here as this forum relates OSMC which is the operating system your device is running, not the actual application. Think of it like running Adobe Photoshop on a PC running Microsoft Windows, if you needed help with a photoshop plugin you would ask on an Adobe forum not a Microsoft one.

Appreciate the help and support so far.

I have been in contact with the developer (or, at least, as close as I can get to the original developer) about these issues over on the kodi website.

I ended up doing a clean reinstall of the addon and now it appears to be more of an addon issue rather than OSMC…which wasn’t clear to me before.

Thanks again for the assistance. I consider this posting closed. However, I expect I’ll return for another topic more closely related to OSMC :slight_smile:

Cheers, regards and happy holidays…