Salvatore Cosentino
Salvatore Cosentino

Reputation: 7230

Pyinstaller fails to import site module in python3 on MacOSX

I am trying to package (freeze) a python3 application using pyinstaller (ver. 3.3.1)

After running pyinstaller my_script.py it fails with a list of import errors, the first of which is the following:

292 INFO: checking Analysis
292 INFO: Building Analysis because out00-Analysis.toc is non existent
292 INFO: Initializing module dependency graph...
298 INFO: Initializing module graph hooks...
299 INFO: Analyzing base_library.zip ...
Failed to import the site module
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 544, in <module>
main()
...

...and continues with a longer list of import errors It could be it is a problem with my python3 configuration, or pyinstaller spec file. I am using at present the default pyinstaller spec file. Following is the system I am testing:

Thanks a lot for all your kind help.

Upvotes: 2

Views: 1545

Answers (1)

jhoe
jhoe

Reputation: 346

Mac 10.13.3

Python 3.6.4

Pyinstaller 3.3.1

I had this problem and my resolution was to:

pip3 uninstall enum34

as per Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?

Upvotes: 5

Related Questions