# Creating aplication appimage based on python2

**URL:** <https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851>\
**Category:** Creating AppImages\
**Created:** [October 4, 2020, 8:41am UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851 "2020-10-04T08:41:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![auhiuw](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@auhiuw](https://discourse.appimage.org/u/auhiuw)\
**Post date:** [October 4, 2020, 8:41am UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/1 "2020-10-04T08:41:09Z")

</div>

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](http://www.diffingo.com/oss/fwbackups) appimage.  
I am able to build [deb](https://build.opensuse.org/package/show/home:13e4e358_opayq.com/fwbackup) package from [source](http://mirror.adct.be/mx/packages/mx/testrepo/pool/test/f/fwbackups/) 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

---

<div class="post-metadata">

**Author:** ![igorlogius](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/igorlogius/32/452_2.png) [@igorlogius](https://discourse.appimage.org/u/igorlogius)\
**Post date:** [October 10, 2020, 2:57pm UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/2 "2020-10-10T14:57:10Z")

</div>

Hello,

this might be useful:

> **[pkg2appimage — AppImage documentation](https://docs.appimage.org/packaging-guide/converting-binary-packages/pkg2appimage.html#converting-python-applications-packaged-with-pip)**

Hope it helps.

---

<div class="post-metadata">

**Author:** ![auhiuw](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@auhiuw](https://discourse.appimage.org/u/auhiuw)\
**Post date:** [October 10, 2020, 7:13pm UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/3 "2020-10-10T19:13:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [October 10, 2020, 7:18pm UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/4 "2020-10-10T19:18:25Z")

</div>

Here is an example without pip and with python2:

> <https://github.com/AppImage/pkg2appimage/blob/master/recipes/Pronterface.yml>

---

<div class="post-metadata">

**Author:** ![auhiuw](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@auhiuw](https://discourse.appimage.org/u/auhiuw)\
**Post date:** [October 14, 2020, 3:51pm UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/5 "2020-10-14T15:51:01Z")

</div>

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](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](http://downloads.diffingo.com/fwbackups/fwbackups-1.43.7.tar.bz2)  
- tar xf fwbackups-1.43.7.tar.bz2

script:

- #!/usr/bin/make -f

- %:

- override\_dh\_auto\_clean:

- override\_dh\_auto\_configure:

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

---

<div class="post-metadata">

**Author:** ![probono](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/probono/32/81_2.png) [@probono](https://discourse.appimage.org/u/probono)\
**Post date:** [October 15, 2020, 6:40pm UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/6 "2020-10-15T18:40:42Z")

</div>

> [@auhiuw](#):
>
> appimage-builder

@azubieta can you have a look please?

---

<div class="post-metadata">

**Author:** ![azubieta](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/azubieta/32/124_2.png) [@azubieta](https://discourse.appimage.org/u/azubieta)\
**Post date:** [October 15, 2020, 7:27pm UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/7 "2020-10-15T19:27:05Z")

</div>

> [@auhiuw](#):
>
> appimage-builder

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: [PyQt5 application — appimage-builder 1.0.0 documentation](https://appimage-builder.readthedocs.io/en/latest/examples/pyqt.html)

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

---

<div class="post-metadata">

**Author:** ![auhiuw](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@auhiuw](https://discourse.appimage.org/u/auhiuw)\
**Post date:** [October 15, 2020, 7:50pm UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/8 "2020-10-15T19:50:41Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![azubieta](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/azubieta/32/124_2.png) [@azubieta](https://discourse.appimage.org/u/azubieta)\
**Post date:** [October 15, 2020, 10:37pm UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/9 "2020-10-15T22:37:02Z")

</div>

> [@auhiuw](#):
>
> are you sure I must use python 3

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 [GitHub - AppImageCommunity/pkg2appimage: Tool and recipes to convert existing deb packages to AppImage](https://github.com/AppImage/pkg2appimage)

---

<div class="post-metadata">

**Author:** ![auhiuw](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@auhiuw](https://discourse.appimage.org/u/auhiuw)\
**Post date:** [October 24, 2020, 10:13am UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/10 "2020-10-24T10:13:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![azubieta](https://yyz1.discourse-cdn.com/flex027/user_avatar/discourse.appimage.org/azubieta/32/124_2.png) [@azubieta](https://discourse.appimage.org/u/azubieta)\
**Post date:** [November 14, 2020, 9:57pm UTC](https://discourse.appimage.org/t/creating-aplication-appimage-based-on-python2/1851/11 "2020-11-14T21:57:29Z")

</div>

@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.
