Skip to content

Commit c33f40c

Browse files
Yacklinlhoestq
andauthored
corrected problematic pip commands generated by _download_additional_modules (#715)
Co-authored-by: Quentin Lhoest <42851186+lhoestq@users.noreply.github.com>
1 parent 91453fd commit c33f40c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/evaluate/loading.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,15 @@ def _download_additional_modules(
260260
lib = importlib.import_module(library_import_name) # noqa F841
261261
except ImportError:
262262
library_import_name = "scikit-learn" if library_import_name == "sklearn" else library_import_name
263+
library_import_path = "scikit-learn" if library_import_path == "sklearn" else library_import_path
263264
library_import_name = "absl-py" if library_import_name == "absl" else library_import_name
264265
library_import_path = "absl-py" if library_import_path == "absl" else library_import_path
265266
needs_to_be_installed.add((library_import_name, library_import_path))
266267
if needs_to_be_installed:
267268
raise ImportError(
268269
f"To be able to use {name}, you need to install the following dependencies"
269270
f"{[lib_name for lib_name, lib_path in needs_to_be_installed]} using 'pip install "
270-
f"{' '.join([lib_path for lib_name, lib_path in needs_to_be_installed])}' for instance'"
271+
f"{' '.join([lib_path for lib_name, lib_path in needs_to_be_installed])}' for instance."
271272
)
272273
return local_imports
273274

0 commit comments

Comments
 (0)