0
votes

I get this error when I try to import wxPython from python 3.7. I have google around but to no luck. Any help would be appreciated.

Traceback (most recent call last): File "C:/Users/STEVE/Desktop/Python Files/Chat Bot/Joyla/joyla.py", line 3, in import wx File "C:\Users\STEVE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\wx__init__.py", line 17, in from wx.core import * File "C:\Users\STEVE\AppData\Local\Programs\Python\Python37-32\lib\site-packages\wx\core.py", line 12, in from ._core import * ImportError: DLL load failed: The specified module could not be found.

1
(1) How did you install wxPython? In particular, did you download some .exe or .msi package and run that? If so, did you make sure you get the right 32- or 64-bit installer? - abarnert
(2) Do you have multiple copies of Python installed? Especially a 32-bit 3.7 and a 64-bit 3.7? If so, what does py --version, python --version, and pip --version (assuming you installed wx with pip in the first place) do? - abarnert
(3) Did you install the wxWidgets library separately from wxPython, through some installer that does both in one, or not at all? If the first one, did you make sure it was the right 32- or 64-bit installer, and the right one for your compiler (MSVC2008 vs. MSVC2017 vs. mingw-tdm etc.)? - abarnert
(1) I installed it using pip - Sêñsëï Fēlìø
(2)Pip version is 18.0 and Python version is 3.7.0 (3)I didn't install wxWidgets separately - Sêñsëï Fēlìø

1 Answers

1
votes

I had this same problem with the same exact error message. It turned out that I have mistakenly installed the 32 bit version of python instead of the 64 bit version.

The python web site will trick you - if you just use the download link on the top page it will give you the 32 bit version. You have to go to the downloads page, then windows, then look for the 64 bit version - "Windows x86-64 executable installer". The actual file name of the 64 bit download is "python-3.7.0-amd64.exe". If you get the 32 bit version the file name will be "python-3.7.0.exe".

Another way to check, after installing, is to open a python console (or a command prompt and type "python" to open the python command line). If you have the 32 bit version it will say: Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32

If you have the 64 bit version it will say: Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32