AWS Thinkbox Discussion Forums

[Solved] Deadline Python API - Import Error

Greetings,
I’m relatively new to both Python and Deadline and I wanted to make some scripts to gather stats about my render jobs.

I’ve been following the documentation, and it says to put the Deadline Python folder from the repository in the site-packages folder of my python install, which is C:\Users\Toto\AppData\Local\Programs\Python\Python38-32\Lib\site-packages for me and so I did, but when I try this line :

from Deadline.DeadlineConnect import DeadlineCon as Connect

I’ve got this error :

Looks like DeadlineConnect.py can’t import Jobs.py even though they’re both in the same folder

Hey Daniel,

Someone correct me here if I’m wrong, but I think you’ve dropped them in the wrong site packages.
Try here?
C:\Python27\Lib\site-packages

Youve dropped it in your %AppData% path

If you open a python shell and run:

import sys
for p in sys.path:
    print(p)

It will show you all the current paths python is aware of

Alternatively from this, you can place them somewhere locally, or on a network drive.
Then point your PYTHON_PATH env variable to this path. Useful for sharing python modules within a local area network.

In a studio env for eg we have all these deadline scripts within Z:\software\scripts\pyMod\Deadline
Then have Z:\software\scripts in everyones PYTHON_PATH env var in a Active Directory Group Policy object.

Hope this helps!

1 Like

Well, I have the paths for the different modules we use in production in our network, and the ones in AppData

image

I guess I could drop the API in our K drive then, I’ll try that

EDIT : Welp, it looks like we already had the Deadline folder in it, and yet I’m stuck with this error. Why is that if Python knows where to look? (which would be K:\SUPERPROD\lib in this case)

Alright, the error is trying to run Python2 code on Python3…

I reinstalled Python 2.7 and ran the file with it and it indeed works, it said “Python 2.7 or later” in the doc so I assumed it worked in Python 3.8, but it didn’t.

Now that I re-read your first post I see py3 in the appdata path, derp sorry bout that!
Should have been my first guess, but non the less, Glad you got it sorted!

Privacy | Site terms | Cookie preferences