Page 1 of 1

lzma module is not available

Posted: Wed Jul 17, 2024 2:17 pm
by fearless_fool
On my Windows 11 system, running inside ESP-IDF 5.2 CMD window, I'm trying to run install.sh as described in

https://github.com/espressif/esp-idf/tr ... pendencies

However, when I run it, it fails with "lzma module is not available":

Code: Select all

PS C:\Espressif\frameworks\esp-idf-v5.2.2> bash install.sh --enable-pytest
Detecting the Python interpreter
Checking "python3" ...
Python 3.10.12
...
Extracting /home/r/.espressif/dist/riscv32-esp-elf-gdb-14.2_20240403-x86_64-linux-gnu.tar.gz to /home/r/.espressif/tools/riscv32-esp-elf-gdb/14.2_20240403
Installing xtensa-esp-elf@esp-13.2.0_20230928
Downloading https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20230928/xtensa-esp-elf-13.2.0_20230928-x86_64-linux-gnu.tar.xz
Destination: /home/r/.espressif/dist/xtensa-esp-elf-13.2.0_20230928-x86_64-linux-gnu.tar.xz.tmp
Done
Extracting /home/r/.espressif/dist/xtensa-esp-elf-13.2.0_20230928-x86_64-linux-gnu.tar.xz to /home/r/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928
Traceback (most recent call last):
  File "/mnt/c/Espressif/frameworks/esp-idf-v5.2.2/tools/idf_tools.py", line 2843, in <module>
    main(sys.argv[1:])
  File "/mnt/c/Espressif/frameworks/esp-idf-v5.2.2/tools/idf_tools.py", line 2835, in main
    action_func(args)
  File "/mnt/c/Espressif/frameworks/esp-idf-v5.2.2/tools/idf_tools.py", line 2056, in action_install
    tool_obj.install(tool_version)
  File "/mnt/c/Espressif/frameworks/esp-idf-v5.2.2/tools/idf_tools.py", line 903, in install
    unpack(archive_path, dest_dir)
  File "/mnt/c/Espressif/frameworks/esp-idf-v5.2.2/tools/idf_tools.py", line 403, in unpack
    archive_obj = tarfile.open(filename, 'r:xz')
  File "/usr/local/lib/python3.10/tarfile.py", line 1817, in open
    return func(name, filemode, fileobj, **kwargs)
  File "/usr/local/lib/python3.10/tarfile.py", line 1921, in xzopen
    raise CompressionError("lzma module is not available") from None
tarfile.CompressionError: lzma module is not available
What's the proper cure for this?

Re: lzma module is not available

Posted: Wed Jul 17, 2024 2:35 pm
by fearless_fool
Addendum:

This line in the script is suspicious:

Code: Select all

Extracting .../.espressif/dist/xtensa-esp-elf-13.2.0_20230928-x86_64-linux-gnu.tar.xz to .../.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928
Traceback (most recent call last):
I'm on a Windows system, not Linux. And I notd that the .espressif/dist directory contains these files:

Code: Select all

-a----         7/15/2024   2:09 PM      270164567 xtensa-esp-elf-13.2.0_20230928-x86_64-w64-mingw32.zip
-a----         7/15/2024   2:08 PM       28366035 xtensa-esp-elf-gdb-14.2_20240403-x86_64-w64-mingw32.zip
So perhaps the script thinks it is running under Linux rather than Windows?

Re: lzma module is not available

Posted: Wed Jul 17, 2024 2:44 pm
by fearless_fool
Solved.

Though the document
https://github.com/espressif/esp-idf/tr ... pendencies
doesn't specify say so, on a Windows system you need to run
.\install.bat
rather than
bash install.sh --enable-pytest

Using .\install.bat the script completed without error.