How do I install graphics.py on Ubuntu 14.04?

9,553

Solution 1

to correct No module named Tkinter and _tkinter

sudo apt-get install tk-dev
cd /Python3.4.1 
./configure
make
sudo make install

Solution 2

Here is a guide:

Start at Zelle’s Python page at http://mcsp.wartburg.edu/zelle/python/.

The graphics module is listed as *graphics.py. RIGHT-CLICK on the link and then select >Save Link As

On a PC save the link in C:\Python31\Lib\site-packages

On a Mac save the link in

/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/site-packages/

On Ubuntu save the link in

/usr/lib/python3/dist-packages

Share:
9,553
jwyer174
Author by

jwyer174

Updated on September 18, 2022

Comments

  • jwyer174
    jwyer174 over 1 year

    I need to install graphics.py for class. How do I do that, and how do I install other Python modules?

    • Sleep Deprived Bulbasaur
      Sleep Deprived Bulbasaur almost 10 years
      Which version of python are you using?
    • jwyer174
      jwyer174 almost 10 years
      I'm using python version 3.4
    • Sylvain Pineau
      Sylvain Pineau almost 10 years
      Where did you find this graphics.py file? Please add a download link to your question
    • jwyer174
      jwyer174 almost 10 years
  • jwyer174
    jwyer174 almost 10 years
    I'm on Ubuntu 14.04 I tried to copy and paste it in usr/local/lib/python3.4/site-packages and usr/local/lib/python3.4/dist-packages
  • Sleep Deprived Bulbasaur
    Sleep Deprived Bulbasaur almost 10 years
    Okay so then what happened?
  • jwyer174
    jwyer174 almost 10 years
    When I use eclipse it doesn't import graphics
  • Sleep Deprived Bulbasaur
    Sleep Deprived Bulbasaur almost 10 years
    @user3485632 have you tried running the program without Eclipse? Eclipse is really only decent for Java.
  • jwyer174
    jwyer174 almost 10 years
    I've tried in Canopy aswell and got this error message: ImportError: libpng16.so.16: cannot open shared object file: No such file or directory
  • jwyer174
    jwyer174 almost 10 years
    I got two import errors ImportError: No module name '_tkinter' and ImportError: No module name 'Tkinter'
  • Sylvain Pineau
    Sylvain Pineau almost 10 years
    I got this error when a run a command in python (2.x). Please be sure to run your script with a python3 interpreter otherwise install python-tk for python2.x: sudo apt-get install python-tk
  • jwyer174
    jwyer174 almost 10 years
    I am using the python 3 interpreter and both versions are installed, I also have this Traceback (most recent call last): File "/usr/local/lib/python3.4/site-packages/graphics.py", line 159, in <module> import tkinter as tk File "/usr/local/lib/python3.4/tkinter/__init__.py", line 38, in <module> import _tkinter # If this fails your Python may not be configured for T
  • jwyer174
    jwyer174 almost 10 years
    and Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.4/site-packages/graphics.py", line 161, in <module> import Tkinter as tk ImportError: No module named 'Tkinter'
  • jwyer174
    jwyer174 almost 10 years
    When I use python 2.7 I don't get any errors and inside python2.7/dist-packages I have virtualenv-1.11.6 and inside python3.4/dist-packages I only have graphics.py
  • gertvdijk
    gertvdijk almost 10 years
    -1 for "out of the blue" upstream Python local build. Why is it needed to compile your own Python here? Please clarify.
  • user340107
    user340107 over 9 years
    reinstall python3 really works on my Ubuntu 14.04. I think .configure and install make python3 be configured for Tkinter