appveyor Ubunu image with python3 lzma module

Dominik's Avatar


17 Sep, 2020 12:43 AM

I am trying to add Linux building/testing using tox to my python package ( and I think I have encountered a problem with the Appveyor Ubuntu images.

To reproduce the problem do the following:
1) connect to the Ubuntu image using SSH as described here:
Note that I do this directly in the init phase! and I do not use any "stack: python 3.X" setting
2) run './venv3.8/bin/python -c "import lzma"' and one observes the following error:

appveyor@appveyor-vm:~$ ./venv3.8/bin/python -c "import lzma"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/appveyor/.localpython3.8.2/lib/python3.8/", line 27, in <module>
    from _lzma import *
ModuleNotFoundError: No module named '_lzma'

Note that lzma is in the standard library and clearly should import without error.
using the systems python3 interpreter the command: 'python3 -c "import lzma"' executes without error. So I think there is some problem with the python interpreters from the virtual environments. googling the problem gives several hints suggesting that its indeed an installation issue. see for example here:

The same behavior is found with the Ubuntu2004 image. When using "stack: python 3.X" the problem seems principally unchanged.

Did I miss something or expect something wrong?

  1. Support Staff 1 Posted by Feodor Fitsner on 18 Sep, 2020 04:04 AM

    Feodor Fitsner's Avatar

    Hi Dominik,

    This is how Python is currently installed on build images:

    It would be great if you could point to the issue in that script causing that error.

  2. 2 Posted by Dominik on 18 Sep, 2020 07:21 AM

    Dominik's Avatar


    you are missing some Python dependencies: The one which is needed for lzma to work properly seems to be "liblzma-dev".

    When I install this using apt and follow your build recipe I get a working Python installation. I tried this on "Ubuntu2004"

    likely you should look at the dependency list here: (see Ubuntu section)

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:


Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac