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

can't import wx #2612

Closed
alvis-spac opened this issue Sep 22, 2024 · 9 comments
Closed

can't import wx #2612

alvis-spac opened this issue Sep 22, 2024 · 9 comments

Comments

@alvis-spac
Copy link

Operating system:windows10
wxPython version & source:wxPython4.2.2
Python version & source: python3.12.2

Description of the problem:
import wx
from wx.core import *
from ._core import *
ImportError: DLL load failed while importing _core:Cannot find the specified module

Code Example (click to expand)
# Put code sample here
@swt2c
Copy link
Collaborator

swt2c commented Sep 22, 2024

Working fine for me on Windows 10 AMD64 with Python 3.12.6.

32-bit or 64-bit? Or ARM64? How did you install wxPython?

@alvis-spac
Copy link
Author

alvis-spac commented Sep 23, 2024

My windows10 is x64. I install wxPython with PycharmCommunity2023 Terminal--pip install wxPython.
Confusing me is that I use other third-party libaries is normal in this way--install and import.

@DietmarSchwertberger
Copy link
Contributor

Working fine here with Python 3.12.0 and 3.12.5:
grafik

What does your site-packages and wx directory look like?
grafik

grafik
...

grafik

@alvis-spac
Copy link
Author

The installation process is automated and I did not modify any directories.
333
1111
1221
444

@DietmarSchwertberger
Copy link
Contributor

Do you have e.g. wxmsw32u_core_vc140_x64.dll in the site-packages directory?
Personally I don't use Virtual Environments, so I don't know whether this is causing the issues.

Maybe, you want to run DependenciesGui.exe to check the dependencies of _core.cp312-win_amd64.pyd.
It's available from here: https://github.com/lucasg/Dependencies
Just run it and drag the .pyd file to it's window.

This is correct:
grafik

This is when I remove the wxmsw...dll:
grafik

@DietmarSchwertberger
Copy link
Contributor

I have tried with a virtual environment and this did work for me.
Strange enough, there is also similar bug report #2614 for MacOS.

@alvis-spac
Copy link
Author

Thanks bro! When I don't install wxpython in a virtual environment, it works fine.

@swt2c
Copy link
Collaborator

swt2c commented Sep 29, 2024

I suspect the root cause here is probably some sort of DLL search path problem with the OP's environment.

@RobinD42
Copy link
Member

RobinD42 commented Nov 8, 2024

This issue has been mentioned on Discuss wxPython. There might be relevant details there:

https://discuss.wxpython.org/t/interesting-install-issue/39992/17

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

No branches or pull requests

4 participants