AWS Thinkbox Discussion Forums

Scripting: custom import works in python2.7 but not dpython

Hi All

I’m working with the python requests library and a deadline event plugin and I’m having some trouble on Linux. I think the problem is probably a lack of understanding on my part as to the difference between dpython and python2.7 in the Deadline/bin folder, so if anyone can offer any pointers it would be really appreciated.

I’ve installed the requests library, and this is the current situation:

This python2.7 works fine:
$ /opt/Thinkbox/Deadline7/bin/python/bin/python2.7
import requests

So does this dpython:
$ /opt/Thinkbox/Deadline7/bin/python/bin/dpython
import requests

But this dpython doesn’t
$ /opt/Thinkbox/Deadline7/bin/dpython
import requests
ImportError: No module named ‘requests.packages.urllib3’
ERROR:root:code for hash md5 was not found…

Which is strange to me, as if I do this
$ /opt/Thinkbox/Deadline7/bin/dpython
import sys
sys.path
The lists of paths are identical, suggesting to me that dpython should have access to the required libraries for requests to work.

What is the difference between the two dpythons?

I’ve attached the pulse log which includes the full Traceback (which seems to all revolve around hashlib). Worth noting as well that this is something I’ve only tested with 7.1 beta.

Thanks

So with some help from a developer far better than me realised that…

/opt/Thinkbox/Deadline7/bin/dpython == Python 2.7.8
/opt/Thinkbox/Deadline7/bin/python/bin/dpython == Python 2.7.6
2.7.6 is UCS4, 2.7.8 is UCS2

We’ve found a bit of a hacky fix for now, but would still be interested if anyone could shed any light on the two versions, and whether it’s due to it being a beta etc…

Ta

The /opt/Thinkbox/Deadline7/bin/dpython file is a shell script that sets up the environment before calling /opt/Thinkbox/Deadline7/bin/python/bin/dpython. If you call /opt/Thinkbox/Deadline7/bin/python/bin/dpython without setting up the environment, it will end up loading the system’s python libraries instead of the python libraries that are shipped with Deadline, and that’s why it shows up as a different version.

I’m assuming your system python is 2.7.6?

Cheers,
Ryan

Aaah, gotcha. That makes a lot of sense. Yup, system python is 2.7.6. Slightly embarrassed I didn’t notice that it’s a shell script!

Thanks for the pointer…

Privacy | Site terms | Cookie preferences