Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import Warning: Not Importing Directory issues using wxPython, don't know how to fix

I keep getting this warning every time I use wxPython:

Warning (from warnings module):
  File "/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/_core.py", line 14581
    import locale
ImportWarning: Not importing directory '/usr/local/lib/wxPython-unicode-2.8.12.1/lib/python2.7/site-packages/wx-2.8-mac-unicode/wx/locale': missing __init__.py

How do I fix this? I'm using wxPython on Mac.

like image 776
runw Avatar asked Dec 14 '25 05:12

runw


1 Answers

It is just a warning; there is no need to fix anything here. You could suppress the warning, perhaps. But it is up to the wxPython project to properly silence that warning.

To suppress the warning, you can use the warnings module:

import warnings
warnings.filterwarnings('ignore', message='Not importing directory .*', module='wx.*')
like image 118
Martijn Pieters Avatar answered Dec 15 '25 18:12

Martijn Pieters



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!