Skip to content

ENH: improve optional import error message #61597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
improve optional import error message
  • Loading branch information
KevsterAmp committed Jun 7, 2025
commit f2b7bd81ba1db8f8be61c902b60b4675c9c953ed
4 changes: 2 additions & 2 deletions pandas/compat/_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ def import_optional_dependency(
install_name = package_name if package_name is not None else name

msg = (
f"Missing optional dependency '{install_name}'. {extra} "
f"Use pip or conda to install {install_name}."
f"`Import {install_name}` failed. {extra} "
f"Use pip or conda to install the {install_name} package."
)
try:
module = importlib.import_module(name)
Expand Down
Loading