Hey Guys I know this has been asked before, and even various times, but I can't really figure out the exact problem with regards to my issue, even after looking at the other import errors. It's a really basic question, so sorry for that...
I'm writing a program, we'll call it "X.py". I need to import from another file, named graphics.py so my first line of code says:
from graphics.py import *
I'm pretty sure the rest of my code is right, but when I run the program it gives me the error saying
Traceback (most recent call last):
File "/Users/me/Desktop/X.py", line 1, in <module>
from graphics import *
ImportError: No module named 'graphics'
Now I clearly have this file downloaded and I put them in a folder called Project X, together.
Any idea how I can get this program to see the other file I guess? Thanks in advance!
2 Answers 2
Drop the .py
Instead, use:
from graphics import *
from graphics import *. Though your error suggests you used the right syntax but python was not able to find graphics because it's not in themodule search path.