tmr232/Sark

Installation on Windows with IDA >= 6.9

Closed this issue · 4 comments

Hi,

I successfully installed sark with Windows 64-bit + IDA 6.8 + Python 2.7 32-bit in the past but cannot make it work with IDA 6.9.

I get the following error::

autostruct.py: cannot import name QtCore
Traceback (most recent call last):
  File "C:\Program Files (x86)\IDA 6.9\python\idaapi.py", line 601, in IDAPython_ExecScript
    execfile(script, g)
  File "C:/.../Sark/plugins/autostruct.py", line 4, in <module>
    import sark
  File "C:\Python27\lib\site-packages\sark-0.1.0-py2.7.egg\sark\__init__.py", line 28, in <module>
    from . import (core,
  File "C:\Python27\lib\site-packages\sark-0.1.0-py2.7.egg\sark\code\__init__.py", line 9, in <module>
    from . import line
  File "C:\Python27\lib\site-packages\sark-0.1.0-py2.7.egg\sark\code\line.py", line 8, in <module>
    from ..ui import updates_ui
  File "C:\Python27\lib\site-packages\sark-0.1.0-py2.7.egg\sark\ui.py", line 6, in <module>
    from .qt import MenuManager
  File "C:\Python27\lib\site-packages\sark-0.1.0-py2.7.egg\sark\qt.py", line 4, in <module>
    from cute import QtCore, QtWidgets, QtGui, use_qt5, connect, disconnect, form_to_widget
ImportError: cannot import name QtCore

This is because I didn't manage to install PyQt5. And Sark relies on cute which relies on PyQt5 [1] for my setup.

Any hint on how to make sark work?

Thanks,
saidelike

[1] https://github.com/tmr232/Cute/blob/master/cute.py#L45

It works now. I fixed this installing by PySide and by forcing PySide to be used in cute.py (C:\Python27\Lib\site-packages\cute\cute.py)

old_path = sys.path[:]
try:
    ida_python_path = os.path.dirname(idaapi.__file__)
    sys.path.insert(0, ida_python_path)
    #if idaapi.IDA_SDK_VERSION >= 690:
    if False:
        from PyQt5 import QtGui, QtCore, QtWidgets
        import sip

        use_qt5 = True
    else:
        from PySide import QtGui, QtCore
        from PySide import QtGui as QtWidgets

        use_qt5 = False
finally:
    sys.path = old_path

I can't reproduce (I have IDA 6.9 and all works OK).

PyQt5 should be installed automatically with IDA - C:\Program Files (x86)\IDA 6.9\python\PyQt5. Do you have this directory?

Thanks for the feedback. Actually yes I have this "PyQt5" directory. I wonder why I had this error then. I'll check if I can replicate again later.

I'm closing it now. If the issue persists, tell me and I'll reopen the issue.