Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal Python error while executing application created in python

short.py

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait
import time

print("Opening...")
driver = webdriver.Chrome('chromedriver.exe')
driver.get('https://google.com')

Converting the above script file to executable file:

pyinstaller short.py

While executing the short.exe Gave me error:

Fatal Python error: initfsencoding: unable to load the file system codec
zipimport.ZipImportError: can't find module 'encodings'

My Python version is 3.7, can anybody please suggest the most appropriate corrective action to take?

like image 384
jumping in ocean Avatar asked Mar 06 '26 02:03

jumping in ocean


1 Answers

Python 3.7 is not supported. After asking relevant questions to OP it is safe to say that they are using an unsupported version of Python when compiling with Pyinstaller.

Alternatives suggested: Wait for support for 3.7 to be introduced in later versions of Pyinstaller. Revert the Python env to 3.6x (Check Pyinstaller website formalist of compatible Python versions first) Ensure that Pyinstaller has not already released a supporting version, in which case you may need to update Pyinstaller instead.

Please follow the link below, the comment suggests you can build the bootloader yourself

Link to issue on GitHub

Hope this helps, Swift

like image 62
Swift Avatar answered Mar 08 '26 15:03

Swift



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!