AppImage

Creating aplication appimage based on python2

Hello,

I would like to ask if or how I can create appimage which is written in python 2?
For my usage I would like to create fwbackups appimage.
I am able to build deb package from source on debian.

Building instructions are simple

Ubuntu/Mint Linux

To install fwbackups from source on Ubuntu, download the source tarball to your home folder and then open a terminal session (select Applications > System Tools > Terminal ). Type the following commands into the terminal:

sudo apt-get install gettext autotools-dev intltool python-crypto python-paramiko python-gtk2 python-glade2 python-notify cron

tar xfj fwbackups-VERSION.tar.bz2

cd fwbackups-VERSION

./configure --prefix=/usr
make && sudo make install

Some Ubuntu distributions no longer include the Python “site-packages” directory in their search path, which may prevent fwbackups from starting. If this is the case, execute this code in addition to the code above:

PYTHONVER=$(python -c ‘import sys;print “%s.%s” % (sys.version_info[0], sys.version_info[1])’)

sudo ln -s …/site-packages/fwbackups /usr/lib/python${PYTHONVER}/dist-packages/fwbackups

I am not a programmer or a code builder. I am just regular linux user who wants such app available when those packages would not be compatible with newer distro.

Regards,

Auhiuw

Hello,

this might be useful:

Hope it helps.

Thx for sharing . But It did not helped.
For building deb package I have followed Debian packaging guidance and requirements.
PIP is something from Python for building project.
I have no such package/library/environment on my OS.

So still not resolved.
As I can see it is not somehow easy to make appimage in my case.

Here is an example without pip and with python2:

I am facing to some errors:

$ appimage-builder --recipe /home/auhiuw/Templates/fwbackups.yml
Traceback (most recent call last):
File “/usr/local/bin/appimage-builder”, line 18, in
main()
File “/usr/local/lib/python3.7/dist-packages/AppImageBuilder/main.py”, line 56, in main
recipe.load_file(args.recipe)
File “/usr/local/lib/python3.7/dist-packages/AppImageBuilder/recipe.py”, line 67, in load_file
self._load_yaml(contents)
File “/usr/local/lib/python3.7/dist-packages/AppImageBuilder/recipe.py”, line 78, in _load_yaml
self.recipe = self._parse_config(data=content)
File “/usr/local/lib/python3.7/dist-packages/AppImageBuilder/recipe.py”, line 142, in _parse_config
return yaml.load(data, Loader=loader)
File “/usr/local/lib/python3.7/dist-packages/yaml/init.py”, line 114, in load
return loader.get_single_data()
File “/usr/local/lib/python3.7/dist-packages/yaml/constructor.py”, line 49, in get_single_data
node = self.get_single_node()
File “/usr/local/lib/python3.7/dist-packages/yaml/composer.py”, line 36, in get_single_node
document = self.compose_document()
File “/usr/local/lib/python3.7/dist-packages/yaml/composer.py”, line 55, in compose_document
node = self.compose_node(None, None)
File “/usr/local/lib/python3.7/dist-packages/yaml/composer.py”, line 84, in compose_node
node = self.compose_mapping_node(anchor)
File “/usr/local/lib/python3.7/dist-packages/yaml/composer.py”, line 133, in compose_mapping_node
item_value = self.compose_node(node, item_key)
File “/usr/local/lib/python3.7/dist-packages/yaml/composer.py”, line 82, in compose_node
node = self.compose_sequence_node(anchor)
File “/usr/local/lib/python3.7/dist-packages/yaml/composer.py”, line 110, in compose_sequence_node
while not self.check_event(SequenceEndEvent):
File “/usr/local/lib/python3.7/dist-packages/yaml/parser.py”, line 98, in check_event
self.current_event = self.state()
File “/usr/local/lib/python3.7/dist-packages/yaml/parser.py”, line 384, in parse_block_sequence_entry
if not self.check_token(BlockEntryToken, BlockEndToken):
File “/usr/local/lib/python3.7/dist-packages/yaml/scanner.py”, line 116, in check_token
self.fetch_more_tokens()
File “/usr/local/lib/python3.7/dist-packages/yaml/scanner.py”, line 260, in fetch_more_tokens
self.get_mark())
yaml.scanner.ScannerError: while scanning for the next token
found character ‘%’ that cannot start any token
in “”, line 25, column 5:
- %:
^

my recipe looks like this:

app: fwbackup

ingredients:
dist: buster
sources:
- deb http://deb.debian.org/debian buster main contrib non-free
packages:
- python-crypto
- python-paramiko
- python-gtk2
- python-glade2
- python-notify

script:
- wget -c http://downloads.diffingo.com/fwbackups/fwbackups-1.43.7.tar.bz2
- tar xf fwbackups-1.43.7.tar.bz2

script:

  • #!/usr/bin/make -f

  • %:

    • dh $@ --with autoreconf
  • override_dh_auto_clean:

    • dh_auto_clean
    • rm -f src/fwbackups-runapp.py
  • override_dh_auto_configure:

    • dh_auto_configure
    • cp src/fwbackups-runapp.pyw src/fwbackups-runapp.py

As a common user I have no idea what I am doing bad.

@azubieta can you have a look please?

It seems that @auhiuw is using an pkg2appimage recipe with appimage-builder. Those are not compatible.

If you would like to proceed with appimage-builder please refer to this guide: https://appimage-builder.readthedocs.io/en/latest/examples/pyqt.html

Python3 is used there but it just a matter of changing the packages.

fwbackups is python 2 based app are you sure I must use python 3?
I am not sure about compatibility between python 2 and 3.
I have used recipe template provided by @probono in his post 5days ago.

Maybe it would be suitable to look at original post where I have posted additional information.

No, you must use python 2. What I mean there is that you should replace the python3 package names by the python 2 ones.

The recipe that @probono gave you must be used with https://github.com/AppImage/pkg2appimage

Hello, @azubieta
I have look at your post after illness.
But I am still confused by using python 3.
Cause s you can see below, some of python packages were not ported/build to python 3.
Therefore I am not bale to build appimage right?

packages:

- python-crypto

- python3-crypto

- python-paramiko

- python3-paramiko
- python-gtk2 -python3 version not found
- python-glade2 -python3 version not found
- python-notify -python3 version not found

Is there any way how to bypass it?

@auhiuw if you require python2 then you must bundle the python2 binaries not the python3 ones. My example was only for illustrating how to do it, if required you can bundle both python 2 and 3.