OS: windows 7 python: 3.7 wxpython: 4.0.3
Here is my code: If I am trying to import wxpython I get an error: see below.
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import wx
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import wx
File "C:\Python37\lib\site-packages\wx\__init__.py", line 17, in <module>
from wx.core import *
File "C:\Python37\lib\site-packages\wx\core.py", line 12, in <module>
from ._core import *
ImportError: DLL load failed: The specified module could not be found.
after import sys, I get a different error.
>>> import sys
>>> import wx
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
import wx
File "C:\Python37\lib\site-packages\wx\__init__.py", line 12, in <module>
__version__ = wx.__version__.VERSION_STRING
AttributeError: module 'wx' has no attribute '__version__'
Searching didn't help much
I do have correct path for the site-packages
>>> sys.path
['', 'C:\\Python37\\Lib\\idlelib', 'C:\\Python37\\python37.zip', 'C:\\Python37\\DLLs', 'C:\\Python37\\lib', 'C:\\Python37', 'C:\\Python37\\lib\\site-packages']
>>>
however, the 'C:\Python37\lib\site-packages' has small l in lib. If go to that folder the lib is spelled with capital L 'Lib'.
The wxpython was installed via pip
C:\Python37>pip3 install wxpython
Collecting wxpython
Downloading https://files.pythonhosted.org/packages/f7/62/bbe01210d84188c666a0
64c87362be9d6a015870f65615f2a9450e7b95b1/wxPython-4.0.3-cp37-cp37m-win32.whl (13
.8MB)
100% |¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶| 13.8MB 2.9MB/s
Requirement already satisfied: six in c:\python37\lib\site-packages (from wxpyth
on) (1.11.0)
Collecting PyPubSub (from wxpython)
Downloading https://files.pythonhosted.org/packages/ab/9e/3b50915d3346971aaa49
074425788598ee4907e67c097e013f1a862bd45c/Pypubsub-4.0.0-py3-none-any.whl (63kB)
100% |¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶¶| 71kB 10.2MB/s
Installing collected packages: PyPubSub, wxpython
Successfully installed PyPubSub-4.0.0 wxpython-4.0.3