So, I'm trying to run my code in Eclipse using PyDev. I've successfully imported:
import socket
import sys
from datetime import datetime
from threading import Thread
import time
import random
import glob
import os
import sys
import math
from pygooglechart import SimpleLineChart
but the below import fails (Unresolved import):
import settings
For reference, settings is used as follows:
# Make a chart
chart = SimpleLineChart(settings.width, settings.height, y_range=(0, max(rateSizeArray)))
chart.add_data(rateSizeArray)
chart.download('send-rates.png')
Examples that I've seen do exactly as I have here and there are no import errors. I have absolutely no idea as to how I to resolve this issue. Any help would be appreciated. Thanks in advance.
-
I think you have to create a file named settings.py and put width and height values in it.thavan– thavan2013年03月28日 06:58:48 +00:00Commented Mar 28, 2013 at 6:58
1 Answer 1
settings sounds like it's your own code - do you have an __init__.py in the directory you're trying to import from? (Python will typically refuse to import from directories that lack an __init__.py file, unless it's the same directory the python interpreter was initially invoked in.)