volatilityfoundation / volatility3

Volatility 3.0 development
http://volatilityfoundation.org/
Other
2.57k stars 443 forks source link

Encountered error while trying to install package python-snappy (Ubuntu 22.04 LTS) #897

Closed jerzybrzoska closed 1 year ago

jerzybrzoska commented 1 year ago

Describe the bug After cloning the repo it does not successfully install the dependencies from requirements.txt. Context Volatility Version: 3 Operating System: Ubuntu Desktop 22.04 LTS Python Version: 3.10.6 Suspected Operating System:
Command:

To Reproduce Steps to reproduce the behavior:

  1. Use command:
    cd "${HOME}" 
    git clone https://github.com/volatilityfoundation/volatility3.git
    cd volatility3
    pip3 install -r requirements.txt
  2. See error:

    
    Cloning into 'volatility3'...
    remote: Enumerating objects: 29828, done.
    remote: Counting objects: 100% (684/684), done.
    remote: Compressing objects: 100% (372/372), done.
    remote: Total 29828 (delta 355), reused 605 (delta 307), pack-reused 29144
    Receiving objects: 100% (29828/29828), 6.03 MiB | 9.40 MiB/s, done.
    Resolving deltas: 100% (22531/22531), done.
    Defaulting to user installation because normal site-packages is not writeable
    Collecting pefile>=2017.8.1
    Downloading pefile-2022.5.30.tar.gz (72 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.9/72.9 KB 2.1 MB/s eta 0:00:00
    Preparing metadata (setup.py) ... done
    Collecting yara-python>=3.8.0
    Downloading yara-python-4.2.3.tar.gz (457 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 457.2/457.2 KB 8.8 MB/s eta 0:00:00
    Preparing metadata (setup.py) ... done
    Collecting capstone>=3.0.5
    Downloading capstone-4.0.2-py2.py3-none-manylinux1_x86_64.whl (2.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 10.8 MB/s eta 0:00:00
    Collecting pycryptodome
    Downloading pycryptodome-3.16.0-cp35-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl (2.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 MB 10.7 MB/s eta 0:00:00
    Collecting leechcorepyc>=2.4.0
    Downloading leechcorepyc-2.14.1-cp36-abi3-manylinux1_x86_64.whl (126 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 126.8/126.8 KB 9.9 MB/s eta 0:00:00
    Collecting python-snappy==0.6.0
    Downloading python-snappy-0.6.0.tar.gz (21 kB)
    Preparing metadata (setup.py) ... done
    Requirement already satisfied: future in /home/jerzy/.local/lib/python3.10/site-packages (from pefile>=2017.8.1->-r requirements.txt (line 2)) (0.18.2)
    Building wheels for collected packages: python-snappy, pefile, yara-python
    Building wheel for python-snappy (setup.py) ... error
    error: subprocess-exited-with-error
    
    × python setup.py bdist_wheel did not run successfully.
    │ exit code: 1
    ╰─> [24 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/snappy
      copying snappy/hadoop_snappy.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/snappy_formats.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/snappy_cffi.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/snappy.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/__main__.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/snappy_cffi_builder.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/__init__.py -> build/lib.linux-x86_64-3.10/snappy
      running build_ext
      building 'snappy._snappy' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/snappy
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c snappy/crc32c.c -o build/temp.linux-x86_64-3.10/snappy/crc32c.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c snappy/snappymodule.cc -o build/temp.linux-x86_64-3.10/snappy/snappymodule.o
      snappy/snappymodule.cc:32:10: fatal error: snappy-c.h: No such file or directory
         32 | #include <snappy-c.h>
            |          ^~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for python-snappy
    Running setup.py clean for python-snappy
    Building wheel for pefile (setup.py) ... done
    Created wheel for pefile: filename=pefile-2022.5.30-py3-none-any.whl size=69376 sha256=1e4f41f0615ac09a53610c5a8ac64f2e8a8994cf07be29708b32b7b597bb9fa2
    Stored in directory: /home/jerzy/.cache/pip/wheels/eb/60/37/ee40403cbd895ccdb57eb28b03b0afabeb449d5df9ce776a0d
    Building wheel for yara-python (setup.py) ... done
    Created wheel for yara-python: filename=yara_python-4.2.3-cp310-cp310-linux_x86_64.whl size=671794 sha256=d9b15654e638bdad63f1d1c081ce65668893aa7ef87ea4dfdcbfb046a777d545
    Stored in directory: /home/jerzy/.cache/pip/wheels/e4/f9/9a/782ba4e25446c571c0d3b75fcf05494345a0ee9a4947448e74
    Successfully built pefile yara-python
    Failed to build python-snappy
    Installing collected packages: yara-python, python-snappy, pycryptodome, pefile, leechcorepyc, capstone
    Running setup.py install for python-snappy ... error
    error: subprocess-exited-with-error
    
    × Running setup.py install for python-snappy did not run successfully.
    │ exit code: 1
    ╰─> [26 lines of output]
      running install
      /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/snappy
      copying snappy/hadoop_snappy.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/snappy_formats.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/snappy_cffi.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/snappy.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/__main__.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/snappy_cffi_builder.py -> build/lib.linux-x86_64-3.10/snappy
      copying snappy/__init__.py -> build/lib.linux-x86_64-3.10/snappy
      running build_ext
      building 'snappy._snappy' extension
      creating build/temp.linux-x86_64-3.10
      creating build/temp.linux-x86_64-3.10/snappy
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c snappy/crc32c.c -o build/temp.linux-x86_64-3.10/snappy/crc32c.o
      x86_64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.10 -c snappy/snappymodule.cc -o build/temp.linux-x86_64-3.10/snappy/snappymodule.o
      snappy/snappymodule.cc:32:10: fatal error: snappy-c.h: No such file or directory
         32 | #include <snappy-c.h>
            |          ^~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]
    
    note: This error originates from a subprocess, and is likely not a problem with pip.
    error: legacy-install-failure

× Encountered error while trying to install package. ╰─> python-snappy

note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

ikelos commented 1 year ago

This looks like it might be a duplicate of #801. This is not a volatility3 issue, but instead an issue of python-snappy and/or ubuntu. Python-snappy seemingly depends on the snappy libraries already being installed via pip. This seems like an unfortunate means of packaging, but is not really an issue that the volatility team can resolve for you. The discussion in #801 revolves around how much we tell other people how to work around the issues they encounter with our dependencies.

As such, I'm going to mark this issue as closed, but if you feel there's more to investigate or contribute, please feel free to reopen it.