Python ImportError: No module named wx

后端 未结 15 1811
余生分开走
余生分开走 2020-12-13 05:56

Im sorry to ask this question again. I have searched and found endles repeats of it both on stackoverflow and also on general google search. Unfortunatly I just cant get my

相关标签:
15条回答
  • 2020-12-13 06:49

    I had the same error today but I tried something and surprisingly it worked. In the site packages folder there will be a file named wx.pth. Open it using notepad and its contents would be like "wx-2.8-msw-unicode"

    It is basically the name of the folder containing wxpython. Delete this using Ctrl + A and copy the name of the folder from the site packages and paste it here even if it is the same.

    Sounds weird but maybe the original file contained a hidden character...

    0 讨论(0)
  • 2020-12-13 06:51

    Generally, package names in the site-packages folder are intended to be imported using the exact name of the module or subfolder.

    If my site-packages folder has a subfolder named "foobar", I would import that package by typing import foobar.

    One solution might be to rename site-packages\wx-2.8-msw-unicode to site-packages\wx.

    Or you could add C:\Python27\Lib\site-packages\wx-2.8-msw-unicode to your PYTHONPATH environment variable.

    0 讨论(0)
  • 2020-12-13 06:52

    You may check if you have the directory where are the packages of Python (in my machine, this dir is C:\Python27\lib\site-packages) in the Path variable on Windows. If Python's path environment variable does not have this directory, you will not find the packages.

    0 讨论(0)
提交回复
热议问题