Import error
What can I do I've tried everything -- https://mail.python.org/mailman/listinfo/python-list
Import graphics error
# This program creates a graphics window with a rectangle. It provides the 3 # template used with all of the graphical programs used in the book. 4 # 5 6 from graphics import GraphicsWindow 7 8 # Create the window and access the canvas. 9 win = GraphicsWindow() 10 canvas = win.canvas() 11 12 # Draw on the canvas. 13 canvas.drawRect(5, 10, 20, 30) 14 15 # Wait for the user to close the window. 16 win.wait() *This is the error I get* Traceback (most recent call last): File "C:/Users/Nicolae/AppData/Local/Programs/Python/Python35/pythonK/pr.py", line 1, in from graphics import GraphicsWindow ImportError: No module named 'graphics' *And when I installed graphic library the error was :* Traceback (most recent call last): File "C:/Users/Nicolae/AppData/Local/Programs/Python/Python35/pythonK/pr.py", line 1, in from graphics import GraphicsWindow ImportError: cannot import name 'GraphicsWindow' -- https://mail.python.org/mailman/listinfo/python-list
Re: Import graphics error
I copied the code from Python from everyone page 67. Following the instructions The graphic modules by John Zelle I copied into the python lacation ,to be easier to find the path . On Tue, Apr 5, 2016 at 11:19 AM, Nicolae Morkov wrote: > # This program creates a graphics window with a rectangle. It provides the > 3 # template used with all of the graphical programs used in the book. > 4 # > 5 > 6 from graphics import GraphicsWindow > 7 > 8 # Create the window and access the canvas. > 9 win = GraphicsWindow() > 10 canvas = win.canvas() > 11 > 12 # Draw on the canvas. > 13 canvas.drawRect(5, 10, 20, 30) > 14 > 15 # Wait for the user to close the window. > 16 win.wait() > > > *This is the error I get* > > Traceback (most recent call last): > File > "C:/Users/Nicolae/AppData/Local/Programs/Python/Python35/pythonK/pr.py", > line 1, in > from graphics import GraphicsWindow > ImportError: No module named 'graphics' > > > *And when I installed graphic library the error was :* > > Traceback (most recent call last): > File > "C:/Users/Nicolae/AppData/Local/Programs/Python/Python35/pythonK/pr.py", > line 1, in > from graphics import GraphicsWindow > ImportError: cannot import name 'GraphicsWindow' > -- https://mail.python.org/mailman/listinfo/python-list
Import graphics error
*Import graphics error* I copied the code below from Python for Everyone page 67. # This program creates a graphics window with a rectangle. It provides the 3 # template used with all of the graphical programs used in the book. 4 # 5 6 from graphics import GraphicsWindow 7 8 # Create the window and access the canvas. 9 win = GraphicsWindow() 10 canvas = win.canvas() 11 12 # Draw on the canvas. 13 canvas.drawRect(5, 10, 20, 30) 14 15 # Wait for the user to close the window. 16 win.wait() **This is the error I get* * Traceback (most recent call last): File "C:/Users/Nicolae/AppData/Local/Programs/Python/Python35/pythonK/pr.py", line 1, in from graphics import GraphicsWindow ImportError: No module named 'graphics' *Following the instructions I copied The graphic modules by John Zelle in Python folder in Lib folder * **And when I installed graphic library the error was :* * Traceback (most recent call last): File "C:/Users/Nicolae/AppData/Local/Programs/Python/Python35/pythonK/pr.py", line 1, in from graphics import GraphicsWindow ImportError: cannot import name 'GraphicsWindow' -- https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list