0

Chaps I am going through what is apparently a #1 problem for python novice. I have been through some tutorials but I really can t get it works. Here is the code :

import time from settings import * from actif_class import * from get_settings import * from dataython import * from spreadython import * from tankython import * if __name__ == "__main__": t0 = time.clock() settings = get_settings() tickers = get_data_mp(settings) list_spreads = get_list_spread(tickers,settings) list_spreads_tank = tanking(list_spreads,settings) spread_traitable = obtention_spreads_traitables(list_spreads_tank,settings) print 'done. Timing',time.clock()-t0,'seconds' 

and here is the stack :

 ImportError: No module named datayhton 

Even though the module DOES exist and is in the same folder as every other modules. It is able to see the get_settings one but not dataython. I ve tried on another machine but still got the same trouble.

I tried to go through import sys, sys.path.append but I might have done something wrong because it still doesnt work.

Any help would be much appreciated.

EDIT : still doesnt work when I write this on top of my code :

import time import sys sys.path.append("/path/to/dataython") 
9
  • you have to download and install this package datayhton and then you can import it. Commented Jan 8, 2015 at 4:26
  • how would I dl and install something I wrote ? Commented Jan 8, 2015 at 4:32
  • If it's not built in package you need to download and install it, you can use pip or just download it from the Internet Commented Jan 8, 2015 at 4:33
  • I might miss your point here but datayhton is not a built in package but a module I ve written. Therefore I dnt really see how I coul dl it from the internet Commented Jan 8, 2015 at 4:36
  • 3
    You spell dataython in some places but datayhton in the code, swapping the h and t. Commented Jan 8, 2015 at 4:59

1 Answer 1

2

Ok. I got it now. Not a no brainer so here is the amended code :

import time import sys sys.path.append("path/to/your/file") import your_file 

the mistake I was doing was keep writing : from your_file import *

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.