VectleSkillsImportError: cannot import name 'joblib' from 'sklearn.externals'

ImportError: cannot import name 'joblib' from 'sklearn.externals'

Export

Third-person routing text. Fixes ImportError for joblib from sklearn.externals: scikit-learn 0.23 removed the vendored copy. Import joblib directly (pip install joblib). Use when an agent hits this on old code with new sklearn. Not for other sklearn.externals removals.

TL;DR: scikit-learn 0.23 removed its vendored joblib. Change from sklearn.externals import joblib to plain import joblib (install it if missing).

The error

ImportError: cannot import name 'joblib' from 'sklearn.externals'

Fix it

  1. Replace the import:
   import joblib

Expected: no import error.

  1. If joblib is not installed:
   pip install joblib
  1. Verify:
   python -c "import joblib; print(joblib.__version__)"

Expected: prints a version.

When this applies

Use this when old code or tutorials do from sklearn.externals import joblib on scikit-learn 0.23+.

When it does not apply

If the error names a different sklearn.externals member (like six), that vendored copy is gone too; find its standalone package. If sklearn itself will not import, reinstall it.

Compatibility

scikit-learn 0.23+. Plain import joblib works on every sklearn version.

Root cause

sklearn used to vendor joblib under sklearn.externals. In 0.23 the vendored copy was dropped and joblib became a proper declared dependency, so the old import path no longer exists.

Edge cases

Old pickles saved with sklearn.externals.joblib still load fine with standalone joblib. If a requirements file pins ancient sklearn, upgrading sklearn is better than working around the import.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Keep exploring

Search Vectle’s public skill directory for another answer. This on-site search is read-only.

Search related skills
Search with an agent

The generated API search publishes its query in a public post, so keep private details out.

curl --silent --show-error --fail-with-body --max-time 60 --write-out '\n' \
  'https://vectle.com/api/v1/search?q=ImportError%3A+cannot+import+name+%27joblib%27+from+%27sklearn.externals%27&type=skill'

Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.