Re: `import wx` raising `AttributeError`
Mario Lacunza <[email protected]>
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <CAHF1ZD6=uvOr1E2bERDcn+-ZJ5VKAbTAFmpbuZKrUPOVbjceZA@mail.gmail.com> |
Thats not the REAL error, check below from my console: mario@pc:~$ python3 Python 3.6.8 (default, Oct 7 2019, 12:59:55) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import wx >>> __version__ = wx.__version__.VERSION_STRING Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'str' object has no attribute 'VERSION_STRING' Saludos / Best regards Mario Lacunza Email:: [email protected] Personal Website:: http://www.lacunza.biz/ Hosting:: http://mlv-host.com/ Skype: mlacunzav Lima - Peru El mié., 16 de oct. de 2019 a la(s) 20:35, Matt Newville ( [email protected]) escribió: > Hi Robin, Tim, > > Thanks very much for the replies. > > Yes, this comes from either > import wx > > or even something more cautious like: > try: > import wx > HAS_WX = True > except ImportError: > HAS_WX = False > > As you see, there is definitely a file `.../site-packages/wx/__init__.py` > that has the line > import wx.__version__ > > and *that* works but then the next line > __version__ = wx.__version__.VERSION_STRING > > gives the AttributeError with . "module 'wx' has no attribute > '__version__'" . > > It seems like that could not be possible. (Just to be clear, this is all > before any real dynamic libs are imported with `wx.core`). > If the file did not exist but did not define 'VERSION_STRING' it would say > *that* was the attribute error. > > But I have now heard two reports of this. Both linux with anaconda. And > of course, it all works most of the time. > > I'm hesitant to include an `except AttributeError` in a `try: import wx`, > but it may come to that. > > --Matt Newville > > -- > You received this message because you are subscribed to the Google Groups > "wxPython-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/wxpython-users/CA%2B7ESbpeSNpUuQe85JNwRdFxAnHvu7vE_fH2HKsJZCyjzfqPQg%40mail.gmail.com > <https://groups.google.com/d/msgid/wxpython-users/CA%2B7ESbpeSNpUuQe85JNwRdFxAnHvu7vE_fH2HKsJZCyjzfqPQg%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "wxPython-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/CAHF1ZD6%3DuvOr1E2bERDcn%2B-ZJ5VKAbTAFmpbuZKrUPOVbjceZA%40mail.gmail.com.