appveyor Ubunu image with python3 lzma module

Dominik's Avatar

Dominik

17 Sep, 2020 12:43 AM

I am trying to add Linux building/testing using tox to my python package (https://github.com/dkriegner/xrayutilities) 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: https://www.appveyor.com/docs/how-to/ssh-to-build-worker/
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/lzma.py", 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: https://github.com/pandas-dev/pandas/issues/27532#issuecomment-514044754

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: https://github.com/appveyor/build-images/blob/master/scripts/Ubuntu...

    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

    Hi,

    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: https://github.com/pyenv/pyenv/wiki (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: https://github.com/pandas-dev/pandas/issues/27532

    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: https://github.com/appveyor/ci/issues/3580

  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

Generic

? 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

 

13 Sep, 2023 06:05 AM
10 Sep, 2023 03:43 PM
09 Sep, 2023 05:53 PM
08 Sep, 2023 07:10 PM
31 Aug, 2023 07:59 PM
13 Aug, 2023 04:55 AM