2

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.

asked Mar 28, 2013 at 6:40
1
  • I think you have to create a file named settings.py and put width and height values in it. Commented Mar 28, 2013 at 6:58

1 Answer 1

3

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.)

answered Mar 28, 2013 at 6:42
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.