Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start HassWP: ZipImportError: can't find module 'encodings'` #65

Open
pedjas opened this issue Nov 2, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@pedjas
Copy link

pedjas commented Nov 2, 2022

I went to the procedure, downloaded zip file, unpacked and run it. This is what I got:

`
D:\HASS\HassWP_2022.8.6>hass.cmd
Python path configuration:
PYTHONHOME = 'C:\PMService_python'
PYTHONPATH = 'C:\PMService_python;C:\PMService_python\python38.zip'
program name = 'python.exe'
isolated = 0
environment = 1
user site = 1
import site = 1
sys._base_executable = 'D:\HASS\HassWP_2022.8.6\python-3.9.10.amd64\python.exe'
sys.base_prefix = 'C:\PMService\_python'
sys.base_exec_prefix = 'C:\PMService\_python\'
sys.platlibdir = 'lib'
sys.executable = 'D:\HASS\HassWP_2022.8.6\python-3.9.10.amd64\python.exe'
sys.prefix = 'C:\PMService\_python'
sys.exec_prefix = 'C:\PMService\_python'
sys.path = [
'C:\PMService\_python',
'C:\PMService\_python\python38.zip',
'D:\HASS\HassWP_2022.8.6\python-3.9.10.amd64\python39.zip',
'C:\PMService\_python\DLLs',
'C:\PMService\_python\lib',
'D:\HASS\HassWP_2022.8.6\python-3.9.10.amd64',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
Traceback (most recent call last):
File "", line 241, in load_module
File "", line 721, in _get_module_code
zipimport.ZipImportError: can't find module 'encodings'

`

I run this on Windows 10.

My guess is that, as I have other application on the same PC that uses it's own instance of Python, which is set in environment (PYTHONHOME and PYTHONPATH), there is conflict and HassWP, tries to load libraries form the wrong place.

When I remove PYTHONHOME and PYTHONPATH, HassWP runs properly. But I cannot leave them removed as other application requires them.

I guess it is possible to configure HassWP to be independent of other Python installations that exist on the same PC. I am not familiar with Python platform so I cannot find how to resolve this.

@AlexxIT AlexxIT added the bug Something isn't working label Jan 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants