-1

So, I have to do a project for school using a graphics window and I'm running Ubuntu 14.04.2 LTS, but whenever I go to get the graphics.py file and save it in the correct directory (/usr/lib/python3/dist-packages) but it says that it failed and that I have insufficient permissions. Someone suggested that I do a chmod for the directory but when I looked it up I was pretty confused. I am new to Ubuntu and have a very basic knowledge of how it works and Terminal, but I am willing to learn. Also, for future reference, if anyone has a link for beginner Ubuntu users, that would be great.

1 Answer 1

0

you don't have to save the graphics.py in /usr/lib/python3/dist-packages, it is easier if you do

make a folder for your project myproject and save the graphics.py in that folder and then make another python module <name it>.py and inside it do

import graphics

or

from graphics import <method name>

or you can put your graphics.py file inside

.local/lib/python3.4/site-packages

this won't require administrative privilages and work for idle3.4

5
  • I tried what you said, and for having it in my myproject file, it came up with the error "Traceback (most recent call last): File "/home/austinhwells/Documents/My Graphics Project/Initials.py", line 1, in <module> import graphics ImportError: No module named 'graphics'" ...same thing for "from graphics import *" and then when I tried to put it in the site-packages directory, it still denied me the permission... Apr 16, 2015 at 3:32
  • had you put the graphics.py in the same directory /home/austinhwells/Documents/My Graphics Project/?
    – bolzano
    Apr 16, 2015 at 3:36
  • to put the file in site packages you don't need permissions.
    – bolzano
    Apr 16, 2015 at 3:36
  • you should have a blank file called__init__.py file to make a folder a module and it will work.
    – bolzano
    Apr 16, 2015 at 3:39
  • make a __init__.py inside the My Graphics Project
    – bolzano
    Apr 16, 2015 at 3:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .