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

Module ‘encodings’ not found error when installing the dependencies #143

Open
robhubi opened this issue Jul 22, 2024 · 1 comment
Open

Comments

@robhubi
Copy link

robhubi commented Jul 22, 2024

My System

OS Microsoft Windows 10 Pro 64bit version 10.0.19045 Build 19045
Python version 3.12.4
OSC tools from 28. Juni 2024

Description

After the Python update to version 3.12, I also updated the KartaView upload scripts. However, the creation of the virtual environment failed. Error message: ModuleNotFoundError: No module named ‘encodings’.

Steps to Reproduce

  1. start OSGeo4W shell as admin
  2. enter commands:
cd /d P:\KartaView\upload-scripts-master
pip3 install virtualenv
virtualenv -p python3 .
scripts\activate.bat
pip3 install -r requirements.txt

The last line results in:

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

See also log file KVI01_Log01.txt

Workaround:

The error disappears if the environment variable PYTHONHOME is set explicitly

set PYTHONHOME=P:\OSGeo4W64\apps\Python312
pip3 install -r requirements.txt

The installation then runs without errors. However, no images can be uploaded, the same error occurs here too. See log file
KVI01_Log02.txt .

Explicitly setting PYTHONHOME can also fix the ModuleNotFound error here, but images still cannot be uploaded. However, this is a different issue.

I don't understand why I have to set PYTHONHOME explicitly now, my previously used version of the tools (from 17 January 2023) worked without it.

@robhubi
Copy link
Author

robhubi commented Jul 23, 2024

I have now tested it:
The same problem occurs with the previous version of the upload-scripts, which did not cause me any problems with Python version 3.9.5. I am very unsure where the problem is located.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant