From 6462bd29cacbc1714e588f25659bb36f17404213 Mon Sep 17 00:00:00 2001 From: Pratyush Das Date: Sun, 28 Jul 2019 17:25:38 -0400 Subject: [PATCH] Fixed xxhash import error --- uproot/source/compressed.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/uproot/source/compressed.py b/uproot/source/compressed.py index 001f7ae2..cd12ea9b 100644 --- a/uproot/source/compressed.py +++ b/uproot/source/compressed.py @@ -8,7 +8,6 @@ from copy import copy import numpy -import xxhash import uproot.const import uproot.source.source @@ -129,6 +128,10 @@ def _prepare(self): elif algo == b"XZ": compression = self.compression.copy(uproot.const.kLZMA) elif algo == b"L4": + try: + import xxhash + except ImportError: + raise ImportError("Install xxhash package with:\n pip install xxhash\nor\n conda install -c conda-forge python-xxhash") compression = self.compression.copy(uproot.const.kLZ4) compressedbytes -= 8 checksum = cursor.field(self._compressed, self._format_field0)