shotgunsoftware / python-api

A Python-based library for accessing Flow Production Tracking API.
https://developer.shotgridsoftware.com/python-api
Other
306 stars 198 forks source link

Unable to Run PyInstaller EXE with shotgun_api 3.3.2 #253

Closed hueyyeng closed 6 months ago

hueyyeng commented 2 years ago

As I'm in the midst of troubleshooting SSL error for select users, I saw there is update to httplib2 and decided to update shotgun_api3.

While it can run fine when executing through a Python interpreter, my studio pipeline requires the tool to be compiled as a standalone exe for artists usage. Here's the error message when trying to run the EXE after upgrading from 3.3.0 to 3.3.2.

image

Currently my workaround is to pip install pyparsing==2.4.7 and modify both site-packages/shotgun_api3/lib/httplib2/python2/auth.py and site-packages/shotgun_api3/lib/httplib2/python3/auth.py

# Existing code
# from ... import pyparsing as pp
# My fix after pip install pyparsing
import pyparsing as pp

After the changes above, I can build normally and run the EXE without issue.

My dev setup is the following:

  1. Python 3.8.10
  2. pyinstaller 4.5.1

I'm excluding the other libraries since they don't use pyparsing

P/S: This is more for other users, there is no need for me to modify the shotgun_api3 package for prior version from 3.3.0 and older when building an EXE using pyinstaller.

hueyyeng commented 6 months ago

Forgotten about this issue and it is no longer a blocker at my prior job. Closing this issue.