Re: `import wx` raising `AttributeError`
Robin Dunn <[email protected]>
| Newsgroups | gmane.comp.python.wxpython |
|---|---|
| Message-ID | <[email protected]> |
On Wednesday, October 16, 2019 at 9:35:07 AM UTC-7, Matt Newville wrote: > > Hi, > > First sorry for the vagueness of the details for this question. > I have a couple of reports hat a package of mine is raising > `AttributeError` when trying to `import wx` instead of the > tested-for-and-should-be-acceptable `ImportError`. That is, I want my > package to be able to use `wx` in many places, but not require it for all > use cases. So, I test `import wx` for `ImportError`. > > The report has this: > > /srv/conda/envs/notebook/lib/python3.6/site-packages/wx/__init__.py in <module> 10 # Load the main version string into the package namespace 11 import wx.__version__---> 12 __version__ = wx.__version__.VERSION_STRING 13 14 > AttributeError: module 'wx' has no attribute '__version__' > > The wx/__version__.py file is generated as part of the build, so perhaps there is something in the conda build scripts or packaging that is either removing or simply not including the file? I don't have any ideas why it would be an AttributeError however. Weird things can happen if there is a wx.py module being imported rather than wxPython's wx package, but presumably it would not be getting to the line above if that were the case. -- Robin -- 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/7bcf21ff-9792-4db4-91fa-21b22ef69286%40googlegroups.com.