Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: cannot import name 'QObject' from 'PyQt5.Qt #55

Open
ShahriyarB opened this issue Sep 9, 2024 · 10 comments · Fixed by #59
Open

ImportError: cannot import name 'QObject' from 'PyQt5.Qt #55

ShahriyarB opened this issue Sep 9, 2024 · 10 comments · Fixed by #59

Comments

@ShahriyarB
Copy link

No matter which version of Python or IDA Pro I use I get this error when I launch IDA Pro with daila plugin
Tested on IDA Pro 7.5, 7.7 and 9.0
Tested with Python 3.9, 3.10, 3.11 and 3.12

C:\Program Files (x86)\IDA Pro 7.5 SP2\plugins\daila_plugin.py: Traceback (most recent call last): File "C:/Program Files (x86)/IDA Pro 7.5 SP2/plugins/daila_plugin.py", line 66, in PLUGIN_ENTRY return create_plugin(*args, **kwargs) File "C:/Program Files (x86)/IDA Pro 7.5 SP2/plugins/daila_plugin.py", line 11, in create_plugin return _create_plugin(*args, **kwargs) File "C:\Users\shahr\AppData\Local\Programs\Python\Python39\lib\site-packages\dailalib\__init__.py", line 50, in create_plugin deci = DecompilerInterface.discover( File "C:\Users\shahr\AppData\Local\Programs\Python\Python39\lib\site-packages\libbs\api\decompiler_interface.py", line 934, in discover from libbs.decompilers.ida.interface import IDAInterface File "C:\Users\shahr\AppData\Local\Programs\Python\Python39\lib\site-packages\libbs\decompilers\ida\interface.py", line 17, in <module> from . import compat File "C:\Users\shahr\AppData\Local\Programs\Python\Python39\lib\site-packages\libbs\decompilers\ida\compat.py", line 28, in <module> from PyQt5.Qt import QObject ImportError: cannot import name 'QObject' from 'PyQt5.Qt' (C:\Program Files (x86)\IDA Pro 7.5 SP2\python\3\PyQt5\Qt.pyd)

@mahaloz
Copy link
Owner

mahaloz commented Sep 9, 2024

@ShahriyarB it looks like your IDA install may be corrupted in some way. To verify it is, try and go into the IDA terminal and write from PyQt5.Qt import QObject. This should never fail since QT5 is bundled with IDA.

@BeErikk
Copy link

BeErikk commented Sep 17, 2024

First: Thanks for the plugin!

I have the error in 8.3 as well.
Testing from PyQt5.Qt import QObject works OK AFAICS.

Error:
C:\dev\devapps\IDA\IDA.8.3\plugins\daila_plugin.py: Traceback (most recent call last): File "C:/dev/devapps/IDA/IDA.8.3/plugins/daila_plugin.py", line 73, in PLUGIN_ENTRY return create_plugin(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:/dev/devapps/IDA/IDA.8.3/plugins/daila_plugin.py", line 11, in create_plugin return _create_plugin(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\dev\devapps\scripts\Python3\Lib\site-packages\dailalib\__init__.py", line 51, in create_plugin deci = DecompilerInterface.discover( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\dev\devapps\scripts\Python3\Lib\site-packages\libbs\api\decompiler_interface.py", line 934, in discover from libbs.decompilers.ida.interface import IDAInterface File "C:\dev\devapps\scripts\Python3\Lib\site-packages\libbs\decompilers\ida\interface.py", line 17, in <module> from . import compat File "C:\dev\devapps\scripts\Python3\Lib\site-packages\libbs\decompilers\ida\compat.py", line 28, in <module> from PyQt5.Qt import QObject ImportError: cannot import name 'QObject' from 'PyQt5.Qt' (C:\dev\devapps\IDA\IDA.8.3\python\3\PyQt5\Qt.pyd)

@mahaloz
Copy link
Owner

mahaloz commented Sep 17, 2024

@BeErikk hmmm ok. Since this is twice now, and you are both on Windows, I'll investigate some. Considering the import works in the terminal, this must be some timing-based error of when we can load the UI.

@mahaloz
Copy link
Owner

mahaloz commented Sep 20, 2024

#59 fixed it on my machine. Updating to version 3.8.1 hopefully fixes it. Please reopen if it does not.

@BeErikk
Copy link

BeErikk commented Oct 3, 2024

Thanks for your effort, but the error persist for me. I exchanged the plugin/daila_plugin.py with the latest version. Is there a good way to reinstall the plugin?

@mahaloz
Copy link
Owner

mahaloz commented Oct 3, 2024

@BeErikk to update you need to do py -m pip install -U dailalib. The daila_plugin.py is just a stub for the Python backend.

@BeErikk
Copy link

BeErikk commented Oct 3, 2024

Thanks (I know nothing about Python). There are still errors but with different messages. I think this error has been up before with a possible solution to upgrade Python. However, I don't think an upgrade will solve anything in my case:

python --version
Python 3.12.2

New error message:

C:\dev\devapps\IDA\IDA.8.3\plugins\daila_plugin.py: Traceback (most recent call last):
  File "C:/dev/devapps/IDA/IDA.8.3/plugins/daila_plugin.py", line 73, in PLUGIN_ENTRY
    return create_plugin(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:/dev/devapps/IDA/IDA.8.3/plugins/daila_plugin.py", line 11, in create_plugin
    return _create_plugin(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\dev\devapps\scripts\Python3\Lib\site-packages\dailalib\__init__.py", line 27, in create_plugin
    gui_ctx_menu_actions["DAILA/LLM/chat"] = ("Open LLM Chat...", get_llm_chat_creator(litellm_api))
                                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\dev\devapps\scripts\Python3\Lib\site-packages\dailalib\llm_chat\__init__.py", line 16, in get_llm_chat_creator
    from dailalib.llm_chat.ida import add_llm_chat_to_ui
  File "C:\dev\devapps\scripts\Python3\Lib\site-packages\dailalib\llm_chat\ida.py", line 3, in <module>
    from PyQt5 import sip
ImportError: DLL load failed while importing sip: Det går inte att hitta den angivna modulen.

@mahaloz mahaloz reopened this Oct 6, 2024
@mahaloz
Copy link
Owner

mahaloz commented Oct 6, 2024

@BeErikk can you try these two possible things:

  1. Switch python version, I have not tested on 3.12, and others have reported some crashing
  2. pip install sip

@m-kozlowski
Copy link

m-kozlowski commented Nov 12, 2024

There should be idapyswitch.exe bundled with IDA.
Run it and select correct version of your python installation, it should replace .pyd files with correct ones.

@mahaloz
Copy link
Owner

mahaloz commented Nov 12, 2024

Wow, it's unexpected that this is another idapyswitch problem. Ha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants