Import graphics error

Michael Selik michael.selik at gmail.com
Tue Apr 5 16:25:49 EDT 2016



> On Apr 5, 2016, at 5:17 PM, Nicolae Morkov <morkovnicolae at gmail.com> wrote:
> 
> 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 .....

Please be more specific. What is the python location? What exactly did you copy? How did you copy? What is the exact path where Python is installed, where these graphics modules are, and where the code is that you're working on?

> On Tue, Apr 5, 2016 at 11:19 AM, Nicolae Morkov <morkovnicolae at gmail.com>
> 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 <module>
>>    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 <module>
>>    from graphics import GraphicsWindow
>> ImportError: cannot import name 'GraphicsWindow'
> -- 
> https://mail.python.org/mailman/listinfo/python-list



More information about the Python-list mailing list