Hope all are doing well. I would like to write a commandline line submission script in python - to run few linux commands on each render nodes to do a system check. What is the initial setup that I have to do in order to get access to deadline python API on my local pc ?
For example if I have to set a pool - which is the path I can use to get access to deadline_python API ?
def getPoolStr():
sys.path.append(deadline_api)
import deadline_api
from deadline_api import GetPools
pool = [‘nuke’]
pool2 = GetPools()
for p in pool2:
if p == “nuke”: continue
pool.append(p)
poolString = “”
for i in pool:
poolString += " "+i
return poolString
If you want to use Deadline’s API outside of Deadline (meaning not an event plugin, application plugin or similar) you’ll want to use the standalone python API. There are details on how to set that up on that page.
On topic and related note, for the below API snippet, the DeadlineCon method requires the Deadline Repository hostname and that should have the Deadline web service running on port 8082, is that correct?
import Deadline.DeadlineConnect as Connect
connectionObject = Connect.DeadlineCon('deadlineHostName', 8082)
If so, how do I get the Deadline Web Service enabled and working for our Deadline Repository instance, as my hunch is probably that’s not setup and running in our case by choice as a part of initial installation/setup. As the below command did not return anything when run on the Deadline Repository machine:
netstat -a | find "8082"
Please let us know your thoughts or pointers in the correct direction will be helpful.
You’ll have to install the web service, and the machine you put the web service on will be the hostname you use. Port 8082 is what’s used if you don’t secure the service with a certificate.
Hello @Justin_B I am able to import Deadline without any error
import Deadline
How do I use this library now?
Tried to use DeadlineConnect and I am getting the following error meesage ?
from Deadline.DeadlineConnect import DeadlineCon as Connect
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\ebijram\python_projects\pyver\py3107\lib\site-packages\Deadline\DeadlineConnect.py”, line 6, in
import Jobs
ModuleNotFoundError: No module named ‘Jobs’
Hi @zainali:
I only did this → Copy the “Deadline” Folder containing the Standalone Python API from \your\repository\api\python to the “site-packages” folder of your Python installation and the API is ready to use.
Do I have to do Web Service configuration in Deadline Client Installation also?
from Deadline import Jobs
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\ebijram\python_projects\pyver\py3107\lib\site-packages\Deadline\Jobs.py”, line 3, in
from ConnectionProperty import ConnectionProperty
ModuleNotFoundError: No module named ‘ConnectionProperty’
From what I know and I am just scratching the surface yet for the Deadline Standalone Python API. And to start testing with it Deadline requires the Web Service to be working. Which needs to be installed.
Forgot to mention, once the web service is installed and configured. You might need to run/start it with the help of the below command. I am running it on a non-repository machine in the network.
I am getting the following error after installing the web services. It seems the Deadline python Module has python2 code as httplib was replaced by http.client in Python3 …?
import Deadline
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\ebijram\python_projects\pyver\py3107\lib\site-packages\Deadline_init_.py”, line 2, in
from .Jobs import Jobs
File “C:\Users\ebijram\python_projects\pyver\py3107\lib\site-packages\Deadline\Jobs.py”, line 3, in
from ConnectionProperty import ConnectionProperty
File “C:\Users/ebijram/python_projects/pyver/py3107/Lib/site-packages/Deadline\ConnectionProperty.py”, line 6, in
import DeadlineSend
File “C:\Users/ebijram/python_projects/pyver/py3107/Lib/site-packages/Deadline\DeadlineSend.py”, line 2, in
import httplib
ModuleNotFoundError: No module named ‘httplib’
import httplib
Traceback (most recent call last):
File “”, line 1, in
ModuleNotFoundError: No module named ‘httplib’
import http.client
Not sure why I did not run into this error, but yes for this temp test/workspace environment my Python version is 3.8.10 and I have setup the python’s virtual environment for this vscode workspace.
See, if that is something feasible to setup in your case and if that helps.
Thanks for the response. But I think it has to do how I have installed the Deadline module. I have followed the instructions from the document you mentioned earlier - by copying the Deadline module folder to the python version site package and then activating the Web-Services. Maybe its the version of the Deadline module - I am using Deadline Client Version: 10.1.14.5 Release - I believe, this version should have Python 3 code ?
We highly recommend to upgrade your Deadline Version, as starting from version 10.1.23 and later Deadline doesn’t require any licenses. Also, ships with Python3, If possible, please upgrade to the latest version.
If you want to continue with the version 10.1.14.5, Deadline can run python3 code but we didn’t ship python3 with that version, so you won’t be able to use WebServiceAPI instead you should use RESTfulAPI
We did upgrade the Deadline version to 10.2.1.1 and copied the Deadline folder from this version to the Python3 site-package directory. I am able to now import
from Deadline.DeadlineConnect import DeadlineCon as Connect
…
con = Connect(dlwebsrv, 8081)
con.Groups.GetGroupNames()
I am getting this error - connection refused. Checked the ports and are listening.
File “C:\Users\ebijram\python_projects\pyver\py391\lib\urllib\request.py”, line 494, in _call_chain
result = func(*args)
File “C:\Users\ebijram\python_projects\pyver\py391\lib\urllib\request.py”, line 1385, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File “C:\Users\ebijram\python_projects\pyver\py391\lib\urllib\request.py”, line 1345, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [WinError 10061] No connection could be made because the target machine actively refused it>