简体   繁体   中英

ImprtError when importing wxPython from Python3.7

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM