job = gl.deploy.job.create(add, x = 1, y = 2) error

User 1952 | 5/19/2015, 7:43:36 AM

Hi

I try try to run the following code from user guide:

job = gl.deploy.job.create(add, x = 1, y = 2)

but I get the following strange error:

[INFO] Validating job. Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/dist-packages/graphlab/deploy/job.py", line 253, in create task = task.Task(function,functionname) File "/usr/local/lib/python2.7/dist-packages/graphlab/deploy/task.py", line 114, in init self.setcode(func) File "/usr/local/lib/python2.7/dist-packages/graphlab/deploy/task.py", line 428, in setcode self.data['codestr'] = inspect.getsource(code) File "/usr/lib/python2.7/inspect.py", line 701, in getsource lines, lnum = getsourcelines(object) File "/usr/lib/python2.7/inspect.py", line 690, in getsourcelines lines, lnum = findsource(object) File "/usr/lib/python2.7/inspect.py", line 538, in findsource raise IOError('could not get source code') IOError: could not get source code

Would you please help me fix it?

Comments

User 1952 | 5/20/2015, 9:12:23 AM

Don't know if it's true, but nobody seems to care!! :(


User 1958 | 5/20/2015, 5:36:31 PM

Hi Andrew, I have been trying to reproduce the problem you are encountering with little success. Are you able to inspect the source for the add function in the interpreter?

You can do this by executing the following lines

import inspect inspect.getsourcelines(add)

If this does not work then it is indicative of a problem with your Python installation. Can you please try this and let us know?

Thanks Sethu


User 1952 | 5/20/2015, 9:19:15 PM

Hi Seth

Thanks for your answer;)

I did it as you told me. here is inputs and outputs:

def add(x, y): ... return x + y ...

import inspect inspect.getsourcelines(add)

Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.7/inspect.py", line 690, in getsourcelines lines, lnum = findsource(object) File "/usr/lib/python2.7/inspect.py", line 538, in findsource raise IOError('could not get source code') IOError: could not get source code

As I said I was running first example on https://dato.com/learn/userguide/deployment/pipeline-introduction.html webpage but I got that error. I'm running python 2.7.6 under ubuntu 14.04.

Best Regards Andrew


User 1952 | 5/21/2015, 4:02:58 PM

Hi

I fixed it. Thank you Seth and Good luck :)

Best Regards Andrew


User 2094 | 7/21/2015, 8:19:20 AM

Hi, Andrew,

I have the same problem. Could you tell me how to fix it? Thanks a lot.

Best Regards Michael