Reputation: 326
I can't get to make an .exe file using Pyinstaller 3.3 and python 3.6, on Windows 10 64bits.
I know all the dependencies are installed because i can run my script without any problems, from the command line.
I checked Pyinstaller page and they say python 3.6 is now supported.
E:\Fichier\Programming\Python>pyinstaller CheckNewEpisodes.py
371 INFO: PyInstaller: 3.3
372 INFO: Python: 3.6.1
372 INFO: Platform: Windows-10-10.0.15063-SP0
374 INFO: wrote E:\Fichier\Programming\Python\CheckNewEpisodes.spec
376 INFO: UPX is not available.
377 INFO: Extending PYTHONPATH with paths
['E:\\Fichier\\Programming\\Python', 'E:\\Fichier\\Programming\\Python']
377 INFO: checking Analysis
378 INFO: Building Analysis because out00-Analysis.toc is non existent
378 INFO: Initializing module dependency graph...
380 INFO: Initializing module graph hooks...
382 INFO: Analyzing base_library.zip ...
Traceback (most recent call last):
File "<string>", line 41, in <module>
File "<string>", line 13, in walk_packages
File "c:\users\del\appdata\local\programs\python\python36\lib\pkgutil.py", line 127, in iter_modules
for name, ispkg in iter_importer_modules(i, prefix):
File "c:\users\del\appdata\local\programs\python\python36\lib\pkgutil.py", line 146, in _iter_file_finder_modules
import inspect
File "c:\users\del\appdata\local\programs\python\python36\lib\inspect.py", line 40, in <module>
import linecache
File "c:\users\del\appdata\local\programs\python\python36\lib\linecache.py", line 11, in <module>
import tokenize
File "c:\users\del\appdata\local\programs\python\python36\lib\tokenize.py", line 33, in <module>
import re
File "c:\users\del\appdata\local\programs\python\python36\lib\re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
Traceback (most recent call last):
File "<string>", line 41, in <module>
File "<string>", line 13, in walk_packages
File "c:\users\del\appdata\local\programs\python\python36\lib\pkgutil.py", line 127, in iter_modules
for name, ispkg in iter_importer_modules(i, prefix):
File "c:\users\del\appdata\local\programs\python\python36\lib\pkgutil.py", line 146, in _iter_file_finder_modules
import inspect
File "c:\users\del\appdata\local\programs\python\python36\lib\inspect.py", line 40, in <module>
import linecache
File "c:\users\del\appdata\local\programs\python\python36\lib\linecache.py", line 11, in <module>
import tokenize
File "c:\users\del\appdata\local\programs\python\python36\lib\tokenize.py", line 33, in <module>
import re
File "c:\users\del\appdata\local\programs\python\python36\lib\re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
4277 INFO: running Analysis out00-Analysis.toc
4280 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
required by c:\users\del\appdata\local\programs\python\python36\python.exe
4346 WARNING: lib not found: api-ms-win-crt-locale-l1-1-0.dll dependency of c:\users\del\appdata\local\programs\python\python36\python.exe
5519 WARNING: lib not found: api-ms-win-crt-runtime-l1-1-0.dll dependency of c:\users\del\appdata\local\programs\python\python36\VCRUNTIME140.dll
5767 WARNING: lib not found: api-ms-win-crt-stdio-l1-1-0.dll dependency of c:\users\del\appdata\local\programs\python\python36\VCRUNTIME140.dll
5773 INFO: Caching module hooks...
5781 INFO: Analyzing E:\Fichier\Programming\Python\CheckNewEpisodes.py
6041 INFO: Processing pre-safe import module hook urllib3.packages.six.moves
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "c:\users\del\appdata\local\programs\python\python36\lib\site-packages\PyInstaller\hooks\pre_safe_import_module\hook-urllib3.packages.six.moves.py", line 31, in pre_safe_import_module
for real_module_name, six_module_name in real_to_six_module_name.items():
AttributeError: 'str' object has no attribute 'items'
I had to truncate the error log, hope this is enough to get an idea about where the problem is.
Upvotes: 0
Views: 2006
Reputation: 326
I solved the bugs, and pyinstaller is awesome !!
First I removed enum34 module, because it was causing compatibility issues, pyinstaller was calling it when I wanted to call just enum.py:
pip uninstall enum34
Then I add --debug when I make an executable so I can see what's wrong
pyinstaller -F --debug scriptname
Then I solve the bugs one by one, most of the time it was missing modules, that were imported secretly by the modules I imported, for example with matplotlib I had to install PyQt5 and PySide, etc
Upvotes: 0
Reputation: 167
You need to make sure any files/data that your script uses is also being packed in with the exe, otherwise when pyinstaller trying to validate that your script works while building it, it will cause an error because the script will not work.
If you can post some of your code that uses the "items" then maybe we can try to help you figure out what you are missing.
In the meantime make sure pyinstaller is including whatever dependencies are needed by including them in the spec file. You can do that as show HERE
Upvotes: 1