PyCharm Community cannot import wxPython libraries

Hello i'm new to python. I write a very little program to test wxPython-phoenix libraries.
I've created the following class, into a GUI.PY file, into a classes folder:

  class Ventana(wx.App):
      def OnInit(self):
          wx.MessageBox("Hola german", "Ventana")
          return True

Then I've created a MAIN.PY as entry point:

  import sys
  import wx
  from classes.GUI import *
  print(sys.path)   # to see if site-packages is in the path. It is

  app = Ventana(False)
  app.MainLoop()

Question is PyCharm doesn't recognize "import wx". It grays the line and throws an error:

  Traceback (most recent call last):
    File "C:/Users/German/Proyectos/Python/nose1/main.py", line 6, in <module>
      from classes.GUI import *
    File "C:\Users\German\Proyectos\Python\nose1\classes\GUI.py", line 3, in <module>
      class Ventana(wx.App):
  NameError: name 'wx' is not defined


Path is:
['C:\\Users\\German\\Proyectos\\Python\\nose1', 'C:\\Python34\\lib\\site-packages\\django-1.7.7-py3.4.egg', 'C:\\Users\\German\\Proyectos\\Python\\nose1', 'C:\\WINDOWS\\system32\\python34.zip', 'C:\\Python34\\DLLs', 'C:\\Python34\\lib', 'C:\\Python34', 'C:\\Python34\\lib\\site-packages']

I can't find why PyCharm doesn't want to import WX..
Thanks in advance.

German

Please sign in to leave a comment.