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

Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding #519

Open
mhsabbagh opened this issue Jul 5, 2022 · 3 comments

Comments

@mhsabbagh
Copy link

Hello.

I am trying to package my application at https://github.com/fosspost/fp-collapse-monitor as an AppImage. I am using pkg2appimage over a local DEB file. This is my simple yml file:

app: fp-collapse-monitor
union: true

ingredients:
  dist: focal
  debs:
    - /home/mhsabbagh/Documents/fp-collapse-monitor_1.0_all.deb

However, after generating the AppImage file, I get the following error when trying to run it:

qt5ct: using qt5ct plugin
Python path configuration:
  PYTHONHOME = '/tmp/.mount_FOSS_PWWFtbU/usr/'
  PYTHONPATH = '/tmp/.mount_FOSS_PWWFtbU/usr/share/pyshared/:'
  program name = '/usr/bin/python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = '/usr/bin/python'
  sys.base_prefix = '/tmp/.mount_FOSS_PWWFtbU/usr'
  sys.base_exec_prefix = '/tmp/.mount_FOSS_PWWFtbU/usr'
  sys.executable = '/usr/bin/python'
  sys.prefix = '/tmp/.mount_FOSS_PWWFtbU/usr'
  sys.exec_prefix = '/tmp/.mount_FOSS_PWWFtbU/usr'
  sys.path = [
    '/tmp/.mount_FOSS_PWWFtbU/usr/share/pyshared/',
    '',
    '/tmp/.mount_FOSS_PWWFtbU/usr/lib/python38.zip',
    '/tmp/.mount_FOSS_PWWFtbU/usr/lib/python3.8',
    '/tmp/.mount_FOSS_PWWFtbU/usr/lib/python3.8/lib-dynload',
  ]
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 0x00007fe3c01efc00 (most recent call first):
<no Python frame>

Attached is the DEB file too if you would like to see it (I had to compress it in ZIP for GitHub to accept it).

What could be the issue here?

Thanks.

fp-collapse-monitor_1.0_all.zip
.

@probonopd
Copy link
Member

Hello, you need to put https:// or http:// URLs into debs:, not a file on the local machine.
This is because recipes need to work on multiple machines without having any required additional files locally.

@mhsabbagh
Copy link
Author

Are you sure about that? The documentation clearly mention that you can use a local DEB file and they give a local path: https://docs.appimage.org/packaging-guide/converting-binary-packages/pkg2appimage.html#using-local-deb-files

I tried what you did and that gave me:

+ cp http://fosspost.org/fp-collapse-monitor_1.0_all.deb .
cp: cannot stat 'http://fosspost.org/fp-collapse-monitor_1.0_all.deb': No such file or directory

This is the YML file:

app: fp-collapse-monitor
union: true

ingredients:
  dist: focal
  debs:
    - https://fosspost.org/fp-collapse-monitor_1.0_all.deb

@probonopd probonopd reopened this Sep 24, 2022
@probonopd
Copy link
Member

Are you sure about that? The documentation clearly mention that you can use a local DEB file and they give a local path

Sorry I was wrong. It's been quite a while ;-)

In any case, pkg2appimage is meant as a last-resort tool to for end user to build their own AppImages for applications that are not provided by their authors in AppImage format. For application authors, there are way better suited tools, especially for Python:

https://github.com/AppImageCommunity/awesome-appimage#deployment-tools-for-python-applications

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

2 participants