Skip to content

Unable to install package due to zstandard dependency?

Greetings! When I try to install the package via pip install scdatatools on my system, it fails to install, citing the following:

ERROR: Failed building wheel for zstandard

I've tried a few different versions of python using pyenv, and nothing has fixed it, not sure what is going wrong. I'm on ArchLinux with everything fully updated and I can't tell if anything is...wrong?

Relevant logs:

Building wheels for collected packages: pycryptodome, zstandard
  Building wheel for pycryptodome (pyproject.toml) ... done
  Created wheel for pycryptodome: filename=pycryptodome-3.9.9-cp311-cp311-linux_x86_64.whl size=13144321 sha256=ff5fc21ceaf88784ccef080b46b6ed31d80d332a4068c3acae22bb04c14a42d1
  Stored in directory: /home/qoon/.cache/pip/wheels/c5/f3/67/ba3e5eafa5abc55a6cd927c2e0c4eabc662a970a9afae3eab4
  Building wheel for zstandard (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for zstandard (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [43 lines of output]
      /tmp/pip-build-env-_ryokyb9/overlay/lib/python3.11/site-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'test_suite'
        warnings.warn(msg)
      /tmp/pip-build-env-_ryokyb9/overlay/lib/python3.11/site-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
      !!
      
              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:
      
              License :: OSI Approved :: BSD License
      
              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
      
      !!
        self._finalize_license_expression()
      running bdist_wheel
      running build
      running build_py
      creating build/lib.linux-x86_64-cpython-311/zstandard
      copying zstandard/cffi.py -> build/lib.linux-x86_64-cpython-311/zstandard
      copying zstandard/__init__.py -> build/lib.linux-x86_64-cpython-311/zstandard
      running build_ext
      building 'zstd' extension
      creating build/temp.linux-x86_64-cpython-311/c-ext
      creating build/temp.linux-x86_64-cpython-311/zstd/common
      creating build/temp.linux-x86_64-cpython-311/zstd/compress
      creating build/temp.linux-x86_64-cpython-311/zstd/decompress
      creating build/temp.linux-x86_64-cpython-311/zstd/dictBuilder
      gcc -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Izstd/decompress -Izstd/common -Ic-ext -Izstd -Izstd/dictBuilder -Izstd/compress -I/home/qoon/Projects/sc-test/.venv/include -I/home/qoon/.pyenv/versions/3.11.13/include/python3.11 -c c-ext/bufferutil.c -o build/temp.linux-x86_64-cpython-311/c-ext/bufferutil.o -DZSTD_MULTITHREAD -DZSTDLIB_VISIBILITY= -DZDICTLIB_VISIBILITY= -DZSTDERRORLIB_VISIBILITY= -fvisibility=hidden
      c-ext/bufferutil.c: In function ‘bufferutil_module_init’:
      c-ext/bufferutil.c:761:46: error: lvalue required as left operand of assignment
        761 |         Py_TYPE(&ZstdBufferWithSegmentsType) = &PyType_Type;
            |                                              ^
      c-ext/bufferutil.c:769:42: error: lvalue required as left operand of assignment
        769 |         Py_TYPE(&ZstdBufferSegmentsType) = &PyType_Type;
            |                                          ^
      c-ext/bufferutil.c:777:41: error: lvalue required as left operand of assignment
        777 |         Py_TYPE(&ZstdBufferSegmentType) = &PyType_Type;
            |                                         ^
      c-ext/bufferutil.c:785:56: error: lvalue required as left operand of assignment
        785 |         Py_TYPE(&ZstdBufferWithSegmentsCollectionType) = &PyType_Type;
            |                                                        ^
      error: command '/usr/bin/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 zstandard
Successfully built pycryptodome
Failed to build zstandard
error: failed-wheel-build-for-install

× Failed to build installable wheels for some pyproject.toml based projects
╰─> zstandard

Thanks in advance for any guidance. This has been attempted on a fresh virtualenv numerous times to no avail on the following:

Python 3.13.5, 3.12.11, 3.11.3