QualCoder icon indicating copy to clipboard operation
QualCoder copied to clipboard

Flatpak, appimage installation

Open glocalglocal opened this issue 2 months ago • 20 comments

I spent several hours trying to install QC on a new Debian Trixie system. I tried Wine, Bottles, winetricks as well as installing from source. In the end I gave up, even though I have several files I coded earlier with QC on the Windows system which I abandoned a few days ago.

I think a flatpak or appimage would help many users greatly. I appreciate this is not trivial, but it may save the developer a lot of time spent on offering support. I suspect there are many users who won't even try using Wine or installing from source. From those who do and run into difficulties, many won't spend hours on an installation.

Here is the last error I received before I gave up:

$ python3 -m qualcoder Error in sys.excepthook: Traceback (most recent call last): File "/home/mike/Downloads/QualCoder-3.7/src/qualcoder/error_dlg.py", line 94, in exception_hook logger.error(("Uncaught exception: ") + msg + '\n' + tb) ^ NameError: name '' is not defined

Original exception was: Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "/home/mike/Downloads/QualCoder-3.7/src/qualcoder/main.py", line 46, in from qualcoder.attributes import DialogManageAttributes File "/home/mike/Downloads/QualCoder-3.7/src/qualcoder/attributes.py", line 28, in from .add_attribute import DialogAddAttribute File "/home/mike/Downloads/QualCoder-3.7/src/qualcoder/add_attribute.py", line 27, in from .helpers import Message File "/home/mike/Downloads/QualCoder-3.7/src/qualcoder/helpers.py", line 27, in from PIL import Image, ImageOps, ImageFilter ModuleNotFoundError: No module named 'PIL'

glocalglocal avatar Oct 12 '25 19:10 glocalglocal

Hi, There is a link to an exe file for the 3.6 version for Ubuntu if that helps here: https://github.com/ccbogel/QualCoder/releases/tag/3.6

There is also this github page using Docker (I am not familiar with it, but it might help): https://github.com/ClarkuCSCI/QualCoder-sshd/tree/main

I am not familiar with flatpak, but would be glad to have someone involve who could make that.

ccbogel avatar Oct 13 '25 21:10 ccbogel

The single 3.6 exe file worked with Q4Wine. It is quite slow to start and doesn't see my VLC but I don't mind. Not suer about the AI stuff but I am not interested. I only had to update some broken links pointing to files in my old Windows setup. They are located in the virtual Z: drive rather than the usual C: drive. Thanks!

Would it be possible to produce a single exe for 3.7 and subsequent versions? That file structure in the portable zip for 3.7 doesn't work here.

A Flatpak or AppImage version would be good though, and it would probably save you and everyone else a lot of headache. I wish I could help with that, but I don’t know how.

glocalglocal avatar Oct 15 '25 00:10 glocalglocal

On startup, the single exe unpacks to basically the same file structure that is now in the portable zip. This is why it takes so long to start. Therefore, I don't believe that the file structure is the problem. There must some other difference between 3.6 and 3.7 that is not compatible with Wine (updated libraries, maybe). IMHO, running QualCoder directly from the python source would be the best solution for you if you want to update in the future. We can help you with that if you post your errors here.

kaixxx avatar Oct 15 '25 09:10 kaixxx

@kaixxx I am not keen on compatibility layers either, but when I tried to follow the instructions to install Qualcoder the proper way, I fell over the first hurdle:

$ sudo apt install python3-pip python3.12-venv
Error: Unable to locate package python3.12-venv
Error: Couldn't find any package by glob 'python3.12-venv'

I suspect it's something obvious like installing python3-venv instead. I experimented a little and got a bit further at some point but this is my work machine and I'd rather not break python so I gave up when I discovered the Wine installation worked.

If it's something obvious I am missing, I will give it another try.

Thanks for offering to help!

glocalglocal avatar Oct 16 '25 16:10 glocalglocal

Let's check first which version of Python is on your system: python3 --version

If it's not version 3.12, this might explain the error that you are getting, since sudo apt install python3.12-venv especially asks for this version.

There is a good chance that QualCoder works with other versions of Python as well. Everything between 3.10 and 3.13 should be worth a try. Just follow the instructions but replace every occurrence of python3.12 with python3.

kaixxx avatar Oct 17 '25 08:10 kaixxx

python3 --version returns Python 3.13.5

I replaced python3.12 with python3 and it was going well until:

pip install -–upgrade pip
pip install -r requirements.txt

Usage:   
  pip install [options] <requirement specifier> [package-index-options] ...
  pip install [options] -r <requirements file> [package-index-options]
  pip install [options] [-e] <vcs project url> ...
  pip install [options] [-e] <local project path> ...
  pip install [options] <archive url/path> ...

no such option: -–
Collecting chardet (from -r requirements.txt (line 1))

pip install -r requirements.txt continues from there until it stops with a massive error that starts like this:

ERROR: Exception:
Traceback (most recent call last):
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_vendor/urllib3/response.py", line 438, in _error_catcher
    yield
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_vendor/urllib3/response.py", line 561, in read
    data = self._fp_read(amt) if not fp_closed else b""

This is where I gave up last time.

glocalglocal avatar Oct 17 '25 10:10 glocalglocal

OK. First of all, you've discovered an error in the readme. If you look closely at the instruction pip install -–upgrade pip, the second hyphen is in fact a different character. It should be pip install --upgrade pip. I have corrected this now: https://github.com/ccbogel/QualCoder/commit/61cd0e5ce18c2d8542941ebcab0d25ddea54f2ec

For the second error, I need the complete message to see what really went wrong. But I have a strong suspicion: Python 3.13, which you are using, is quite new. There might be incompatibilities with some libraries in QualCoder. This is why I still use python 3.12 as my development platform. If you continue getting errors, installing python 3.12 (and replacing all the python3 command in the instructions with python3.12) might be the way to go.

kaixxx avatar Oct 17 '25 11:10 kaixxx

pip install --upgrade pip worked.

Here is the complete error message:

Downloading nvidia_nccl_cu12-2.27.5-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (322.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━ 269.5/322.3 MB 6.4 MB/s eta 0:00:09
ERROR: Exception:
Traceback (most recent call last):
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_vendor/urllib3/response.py", line 438, in _error_catcher
    yield
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_vendor/urllib3/response.py", line 561, in read
    data = self._fp_read(amt) if not fp_closed else b""
           ~~~~~~~~~~~~~^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_vendor/urllib3/response.py", line 527, in _fp_read
    return self._fp.read(amt) if amt is not None else self._fp.read()
           ~~~~~~~~~~~~~^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 102, in read
    self.__buf.write(data)
    ~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/tempfile.py", line 690, in func_wrapper
    return func(*args, **kwargs)
OSError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/cli/base_command.py", line 107, in _run_wrapper
    status = _inner_run()
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/cli/base_command.py", line 98, in _inner_run
    return self.run(options, args)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/cli/req_command.py", line 71, in wrapper
    return func(self, options, args)
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/commands/install.py", line 393, in run
    requirement_set = resolver.resolve(
        reqs, check_supported_wheels=not options.target_dir
    )
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 184, in resolve
    self.factory.preparer.prepare_linked_requirements_more(reqs)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/operations/prepare.py", line 564, in prepare_linked_requirements_more
    self._complete_partial_requirements(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        partially_downloaded_reqs,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
        parallel_builds=parallel_builds,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/operations/prepare.py", line 479, in _complete_partial_requirements
    for link, (filepath, _) in batch_download:
                               ^^^^^^^^^^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/network/download.py", line 184, in batch
    filepath, content_type = self(link, location)
                             ~~~~^^^^^^^^^^^^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/network/download.py", line 195, in __call__
    self._process_response(download, resp)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/network/download.py", line 212, in _process_response
    for chunk in chunks:
                 ^^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/cli/progress_bars.py", line 67, in _rich_download_progress_bar
    for chunk in iterable:
                 ^^^^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_internal/network/utils.py", line 65, in response_chunks
    for chunk in response.raw.stream(
                 ~~~~~~~~~~~~~~~~~~~^
        chunk_size,
        ^^^^^^^^^^^
    ...<22 lines>...
        decode_content=False,
        ^^^^^^^^^^^^^^^^^^^^^
    ):
    ^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_vendor/urllib3/response.py", line 622, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_vendor/urllib3/response.py", line 560, in read
    with self._error_catcher():
         ~~~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/home/user/Downloads/apps/QualCoder-3.7/env/lib/python3.13/site-packages/pip/_vendor/urllib3/response.py", line 455, in _error_catcher
    raise ProtocolError("Connection broken: %r" % e, e)
pip._vendor.urllib3.exceptions.ProtocolError: ("Connection broken: OSError(28, 'No space left on device')", OSError(28, 'No space left on device'))

glocalglocal avatar Oct 17 '25 12:10 glocalglocal

OSError: [Errno 28] No space left on device

It seems that your hard drive is full ;)

kaixxx avatar Oct 17 '25 12:10 kaixxx

Not sure which drive it's referring to. There is plenty of space in / and /home and I have no issues installing applications including the less efficient Wine/Qualcoder combo. Unless it is referring to a tmpfs or the swapfile managed by zram.

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            3.8G     0  3.8G   0% /dev
tmpfs           783M  1.9M  781M   1% /run
/dev/sda6        84G   40G   41G  50% /
tmpfs           3.9G  480K  3.9G   1% /dev/shm
efivarfs         64K   21K   39K  35% /sys/firmware/efi/efivars
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           1.0M     0  1.0M   0% /run/credentials/systemd-journald.service
tmpfs           3.9G   92K  3.9G   1% /tmp
/dev/sda5       976M  8.8M  967M   1% /boot/efi
/dev/sda7       318G  164G  139G  55% /home
tmpfs           783M   78M  706M  10% /run/user/1000
/dev/sda1       1.4G   11M  1.4G   1% /media/mike/System

This is a dual boot Windows/Debian system. Also, I see there are errors reported before it gets to that out-of-space error.

glocalglocal avatar Oct 17 '25 13:10 glocalglocal

It depends on where pip stores temporary files.

However, the root cause might still be that you use python 3.13. If no binaries are available for this version, pip might try to build some libraries from source, which could result in a lot of temporary files. I would suggest switching to a fresh python 3.12 env:

  • pyenv versions shows you all version available on your system
  • If 3.12 is not available, you can add it with pyenv install 3.12.6
  • pyenv shell 3.12.6 switches to this version temporarily for this terminal session (try with python --version)
  • Create a virtual environment under 3.12: python -m venv ~/venvs/qualcoder312
  • Activate: source ~/venvs/qualcoder312/bin/activate
  • pip install -r requirements.txt

kaixxx avatar Oct 17 '25 15:10 kaixxx

The plot thickens! I had to install pyenv and then:

user@pc:~$ pyenv versions
* system (set by /home/mike/.pyenv/version)
  3.12.6
user@pc:~/Downloads/apps/QualCoder-3.7$ python --version
pyenv: python: command not found

The `python' command exists in these Python versions:
  3.12.6

Note: See 'pyenv help global' for tips on allowing both
      python2 and python3 to be found.
user@pc:~/Downloads/apps/QualCoder-3.7$ python3 --version
Python 3.13.5
user@pc:~/Downloads/apps/QualCoder-3.7$ pyenv shell 3.12.6
pyenv: shell integration not enabled. Run `pyenv init' for instructions.
user@pc:~/Downloads/apps/QualCoder-3.7$ pynenv init
bash: pynenv: command not found
user@pc:~/Downloads/apps/QualCoder-3.7$ pyenv init
# Load pyenv automatically by appending
# the following to 
# ~/.bash_profile if it exists, otherwise ~/.profile (for login shells)
# and ~/.bashrc (for interactive shells) :

export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - bash)"

# Restart your shell for the changes to take effect.

user@pc:~/Downloads/apps/QualCoder-3.7$ cat ~/.profile 
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022

# if running bash
if [ -n "$BASH_VERSION" ]; then
    # include .bashrc if it exists
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH"
fi

# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi

# $ pyenv init
# Load pyenv automatically by appending
# the following to 
# ~/.bash_profile if it exists, otherwise ~/.profile (for login shells)
# and ~/.bashrc (for interactive shells) :

export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init - bash)"

Before you ask, ~/.bash_profile and ~/.bash_login do not exist, and I rebooted. ;)

glocalglocal avatar Oct 17 '25 16:10 glocalglocal

Hmm, I'm a little bit lost. So python 3.12 is on your system, but you don't get pyenv to initialize properly?

This is what ChatGPT has to say, seems reasonable:

=========================================

You’re super close—two things are happening:

  1. Your shell isn’t loading pyenv’s shims (so pyenv shell 3.12.6 fails).
  2. Your active version is system, which usually has no python binary (only python3). That’s why pyenv says “python exists in 3.12.6” but still can’t find it: you’re not actually using 3.12.6 yet.

Do this once to fix shell integration (Bash):

# Add pyenv init to your interactive shell
cat >>~/.bashrc <<'EOF'
export PYENV_ROOT="$HOME/.pyenv"
# Ensure pyenv is on PATH
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
# Initialize pyenv (adds shims to PATH)
eval "$(pyenv init -)"
# (Optional) If you use pyenv-virtualenv:
# eval "$(pyenv virtualenv-init -)"
EOF

# (You already added similar lines to ~/.profile — that’s fine for login shells.)
# Reload your shell as a login shell so both .profile and .bashrc are read:
exec bash -l

Now select the Python you want (globally or just for this project):

# Global (affects your user):
pyenv global 3.12.6

# OR per-project (recommended inside QualCoder-3.7 folder):
cd ~/Downloads/apps/QualCoder-3.7
pyenv local 3.12.6

Verify it worked:

pyenv versions         # should show 3.12.6 with a *
command -v python      # should point into ~/.pyenv/shims/python
python --version       # Python 3.12.6
python3 --version      # Python 3.12.6 (pyenv shim)

If it still doesn’t switch:

  • Make sure ~/.pyenv/shims appears before system paths: echo "$PATH" | tr ':' '\n" | nl (the shims get added by eval "$(pyenv init -)").
  • Double-check there are no typos (earlier you tried pynenv init—should be pyenv).
  • If 3.12.6 wasn’t fully installed, reinstall: pyenv install -s 3.12.6 && pyenv rehash

Why python3 showed 3.13.5 earlier: that was your system Python bypassing pyenv. Once shims are active and you set global/local 3.12.6, both python and python3 will resolve to pyenv’s 3.12.6, so QualCoder can run.

kaixxx avatar Oct 17 '25 18:10 kaixxx

It almost worked but I got again out-of-space:

Downloading nvidia_nccl_cu12-2.27.5-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (322.3 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━ 207.6/322.3 MB 7.2 MB/s eta 0:00:16ERROR: Could not install packages due to an OSError: [Errno 28] No space left on device

   ━━━━━━━━━━━━━━━━━━━━━━━━━╸━━━━━━━━━━━━━━ 207.9/322.3 MB 7.2 MB/s eta 0:00:16

Like before, df says otherwise.

Thanks for your patience. I think we can agree that many users, certainly the vast majority of Windows refugees, would have given up ages ago, which is why I think a Flatpak or Appimage would be a good idea. There are far too many moving parts otherwise.

glocalglocal avatar Oct 23 '25 16:10 glocalglocal

Thank you for your patience as well. Indeed, it might be best to stick with the Wine installation for now. I wouldn't have thought that installing some very common python libraries under Linux creates so much trouble. I totally agree that it would be very desirable to have a more universal solution for Linux. What are your experiences with flatpak? Is it a reliable way to distribute large and complex apps for Linux? I was wondering how mature this solution already is.

kaixxx avatar Oct 24 '25 07:10 kaixxx

Many see Flatpak as the future of Linux. I would say it is the present too. Even among users of conservative Debian Stable, the advice now is Debian + flatpaks give you reliability as well as freshness when you need it. Most of my substantial applications are now flatpaks (including Firefox and Thunderbird) -- see https://flathub.org . Flatpaks are larger to download and store, but with storage being so cheap most users don't mind if that's the price of reliability, ease and containerisation. They launch slightly more slowly but you can't tell even on my slow machine.

The advantage is you get universal installation, containerisation and automatic updates.

I only had issues with three applications and that was because of the way they were packaged. Signal and Element wouldn't speak to kwallet for encryption. I fixed that by changing their permissions through Flatseal. Viber won't detect the camera, and again I am sure it's something to do with permissions.

So, yes, I am absolutely in favour of Flatpak especially for Windows refugees and less hand-holding.

glocalglocal avatar Oct 24 '25 10:10 glocalglocal

In Linux Flatpak is the present and the near future, with growing adoption by distributions, applications and users. A Flatpak version of QualCoder would help a lot to reach more distributions and users.

zapatist-free avatar Oct 31 '25 13:10 zapatist-free

In Linux Flatpak is the present and the near future

Thank you. I agree that having a flatpack version would be nice. Would you be able to work on that, @zapatist-free? I don't have the skills.

kaixxx avatar Oct 31 '25 14:10 kaixxx

I agree it would be good, but also, I do not have the skills to make a flatpak.

ccbogel avatar Oct 31 '25 21:10 ccbogel

I looked at the instructions on Flathub and although the process doesn't look too complicated, it's still beyond what I could help with I am afraid. Posting a question on the flatpak subreddit might be an idea. Could this issue remain open and be tagged as 'Help needed' or something?

glocalglocal avatar Nov 03 '25 12:11 glocalglocal