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

Raspberry Pi Bookworm - Fatal Python error: init_fs_encoding #1177

Open
aluminum-ice opened this issue Jun 21, 2024 · 2 comments · Fixed by #1198
Open

Raspberry Pi Bookworm - Fatal Python error: init_fs_encoding #1177

aluminum-ice opened this issue Jun 21, 2024 · 2 comments · Fixed by #1198
Labels
3.X.X Bug close pending dependencies Pull requests that update a dependency file

Comments

@aluminum-ice
Copy link

I compiled ncpa from source into a debian package. No issues with the compilation. Installed the deb pacakge ncpa_3.1.0-1_arm64.deb without issue:

pi@raspberrypi:~/github/ncpa/build $ sudo dpkg -i ./ncpa_3.1.0-1_arm64.deb

Selecting previously unselected package ncpa.
(Reading database ... 124238 files and directories currently installed.)
Preparing to unpack ./ncpa_3.1.0-1_arm64.deb ...
Try to stop services with systemctl
Try to stop services with service
Unpacking ncpa (3.1.0-1) ...
Setting up ncpa (3.1.0-1) ...
Processing triggers for libc-bin (2.36-9+rpt2+deb12u7) ...

Every attempt to start, stop or restart the ncpa service results in a python error:

pi@raspberrypi:~/github/ncpa/build $ sudo /etc/init.d/ncpa start

Started NCPA
Python path configuration:
  PYTHONHOME = (not set)
  PYTHONPATH = (not set)
  program name = '/usr/local/ncpa/ncpa'
  isolated = 0
  environment = 0
  user site = 1
  safe_path = 0
  import site = 0
  is in build tree = 0
  stdlib dir = ''
  sys._base_executable = '/usr/local/ncpa/ncpa'
  sys.base_prefix = ''
  sys.base_exec_prefix = ''
  sys.platlibdir = 'lib'
  sys.executable = '/usr/local/ncpa/ncpa'
  sys.prefix = ''
  sys.exec_prefix = ''
  sys.path = [
    '/usr/local/ncpa/lib',
  ]
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'

Current thread 0x00007fffb953cb00 (most recent call first):
  <no Python frame>

I think the issue is with the (new) managed python package environment but every attempt to fix it fails. Any help or ideas?

@MrPippin66
Copy link

MrPippin66 commented Jun 24, 2024

Which specific python do you have? Primary issue above is the PYTHONHOME isn't defined. Could be a "cx freeze" issue, though. Which specific cx freeze version is installed?

@sawolf sawolf added Bug dependencies Pull requests that update a dependency file 3.X.X labels Jun 27, 2024
@aluminum-ice
Copy link
Author

Hi, this is what I see:

cx_freeze in /usr/local/lib/python3.11/site-packages (7.1.1)

I tried export PYTHONHOME=/usr/local/ but NCPA still reports the env variable as blank.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.X.X Bug close pending dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants