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)

  3. 3 Posted by Michael Hanke on 04 Dec, 2020 08:20 AM

    Michael Hanke's Avatar

    I can confirm the report by Dominik for Ubuntu 18.04 and Ubuntu 20.04. I can also confirm the diagnosis of missing Python build dependencies.

    Here is a popular bug report the illustrates the issue:

    This makes all virtualenvs provided by these images unusable in this regard.

  4. Support Staff 4 Posted by Feodor Fitsner on 04 Dec, 2020 04:06 PM

    Feodor Fitsner's Avatar

    Thank you!

    We've added an issue to fix that in the next update:

  5. Feodor Fitsner closed this discussion on 03 Feb, 2021 09:03 PM.

Comments are currently closed for this discussion. You can start a new one.

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