0

I'm new to pyinstaller and trying to package a script I wrote that connects to Smartsheet. The code runs fine in PyCharm, but when I go to run the executable that it outputs the client object is just treated as a string and won't let me access any attributes.

ImportError! Could not load api or model class Users
Traceback (most recent call last):
 File "filename.py", line XX, in <module>
AttributeError: 'str' object has no attribute 'get_current_user'
[1480] Failed to execute script filename

PyInstaller: 3.4 Python: 3.6.5 Windows: 7

Update:

It looks like smartsheet is trying to import the requests.packages.urllib3 library but this is failing. I've tride adding the directory to this file using:

pyi-makespec --paths=directory\requests\packages.py myapp.py pyi-makespec --paths=directory\smartsheet\smartsheet.py myapp.py

but it's still failing.

  • Does the answer on this other SO thread help? https://stackoverflow.com/questions/42814390/pyinstaller-hidden-imports Also, more info here about hidden imports that may be relevant to your issue: https://pythonhosted.org/PyInstaller/when-things-go-wrong.html#listing-hidden-imports Note that the first link says `--hidden-imports` (plural) while the second one says `--hidden-import` singular. – Kim Brandl Oct 02 '18 at 23:08
  • I've added the error and tried --hidden-import with urllib3, requests, and smartsheet still no luck – Sam Drescher Oct 09 '18 at 17:34
  • I've also tried running the same situation with Python 3.4 as that allows me to keep enum34 which is a requirement of one of my packages and still it fails – Sam Drescher Oct 09 '18 at 22:00

0 Answers0