Created
November 30, 2015 06:44
-
-
Save GaryLee/d191f239acf2f47bec93 to your computer and use it in GitHub Desktop.
Fix ".constants.json" not found issue when using Pyinstaller to pack openpyxl.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# When you're encountering following error. | |
# > IOError: [Errno 2] No such file or directory: 'C:\\Users\\username\\AppData\\Local\\Temp\\_MEI502322\\openpyxl\\.constants.json' | |
# | |
# This solution tested under Python 2.7.10 and Pyinstaller 3.0. | |
# | |
# Put this file to your script folder. | |
# Add this hook to your distribution by | |
# > pyinstaller --onefile --additional-hooks-dir=. yourscript.py | |
# | |
from PyInstaller.utils.hooks import collect_data_files | |
# Instruct pyinstaller to collect data files from openpyxl package. | |
datas = collect_data_files('openpyxl') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks