mstampfer / Coursera-Stanford-ML-Python

Coursera/Stanford Machine Learning course assignments in python
445 stars 231 forks source link

Submit function not working in Python 3.5.2 #9

Open ajrcre opened 7 years ago

ajrcre commented 7 years ago

I am using Python 3.5.2. When I try to submit I get the following error:

An exception of type KeyError occured. Messsage:
("'__name__' not in globals",)

If I remove the catch error function, I get:

Traceback (most recent call last):
  File "submit.py", line 58, in <module>
    s.submit()
  File "/Users/shaharb/kaggle/ml_coursera/Coursera-Stanford-ML-Python-master/Submission.py", line 27, in submit
    parts[str(part_id)] = {'output': self.__output(part_id)}
  File "submit.py", line 39, in output
    mod = __import__(fname, fromlist=[fname], level=1)
KeyError: "'__name__' not in globals"
jtlowery commented 7 years ago

@ajrcre It might be a bit late for you, but I have a branch that I modified for py3.5 as I went through the course (https://github.com/jtlowery/Coursera-Stanford-ML-Python/tree/py3_update).