Resolved. The issue was I was running the script with the python version from my bin rather than the virtual env.