3

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?

6
  • What Python version are you using please? Commented Sep 1, 2018 at 15:00
  • @Swift I am using 3+ version... Commented Sep 1, 2018 at 15:05
  • Python 3.7 is not supported. Can you tell me specifically which version you currently have installed? python -V on the command line. or py -3 --version Commented Sep 1, 2018 at 15:06
  • @Swift Yes, its Python 3.7. As you said it is not supported, then what are the alternatives... Commented Sep 1, 2018 at 15:22
  • Wait for pyinstaller to receive an update whereby they add support for Python 3.7+ or alternatively you could uninstall Python and install a 3.6 version. Commented Sep 1, 2018 at 15:24

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

I don't need encodings in script file then why should I?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.