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: Typelib different than module #231

Closed
gesslerpd opened this issue Apr 30, 2021 · 4 comments
Closed

ImportError: Typelib different than module #231

gesslerpd opened this issue Apr 30, 2021 · 4 comments

Comments

@gesslerpd
Copy link

I'm using comtypes==1.1.10 indirectly via use of wxPython and recently am getting an ImportError that doesn't occur in comtypes<=1.1.8. Any help or guidance is appreciated!

OS: Windows 10
Traceback:

  File ".\script.py", line 22, in <module>
    from wx.lib.activex import ActiveXCtrl
  File ".\venv\lib\site-packages\wx\lib\activex.py", line 43, in <module>
    cc.GetModule(f)
  File ".\venv\lib\site-packages\comtypes\client\_generate.py", line 118, in GetModule
    mod = _CreateWrapper(tlib, pathname)
  File ".\venv\lib\site-packages\comtypes\client\_generate.py", line 198, in _CreateWrapper
    mod = _my_import(fullname)
  File ".\venv\lib\site-packages\comtypes\client\_generate.py", line 19, in _my_import
    return __import__(fullname, globals(), locals(), ['DUMMY'])
  File ".\venv\lib\site-packages\comtypes\gen\_99AB80C4_5E19_4FD5_B3CA_5EF62FC3F765_0_1_0.py", line 358, in <module>   
    from comtypes import _check_version; _check_version('1.1.10', 0.000000)
  File ".\venv\lib\site-packages\comtypes\__init__.py", line 38, in _check_version
    raise ImportError("Typelib different than module")
ImportError: Typelib different than module
@vasily-v-ryabov
Copy link
Collaborator

Can you try this branch?

pip uninstall -y comtypes
pip install https://github.com/vasily-v-ryabov/comtypes/archive/refs/heads/mtime_none.zip

@vasily-v-ryabov
Copy link
Collaborator

You will need to clear local comtypes cache using script in C:\path-to-python\Scripts\

@gesslerpd
Copy link
Author

Thanks for your response, this fix solves the issue! The cached files generated now don't cause the mentioned Typelib error.

@fusentasticus
Copy link
Contributor

Please re-open this issue --- as per #237 there are still problems it would appear. Also, the fix (if it is) never made into the pypi channel as version 1.1.11. I'm going through the code myself now to see whether I can puzzle this out.

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

No branches or pull requests

3 participants