embedchain ec: No module named 'pkg_resources' (fix)
embedchain 0.1.128 (the last release) does import pkg_resources in embedchain/utils/cli.py, so the ec command fails with ModuleNotFoundError: No module named 'pkg_resources' on setuptools 82+. Tested fix: pip install "setuptools<81".
1. The error: the ec command from embedchain 0.1.128
pip install embedchain gives 0.1.128 (2025-03-25), the last release. It does not depend on setuptools, so it uses whatever the venv has. In a Python 3.11 venv with setuptools 84.2.1, the ec command fails before it shows any help:
$ ec --help
Traceback (most recent call last):
...
from embedchain.cli import cli
File "embedchain/cli.py", line 17, in <module>
from embedchain.utils.cli import (
File "embedchain/utils/cli.py", line 6, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
embedchain/utils/cli.py line 6 is a plain import pkg_resources. It uses it to find its bundled app templates (pkg_resources.resource_filename("embedchain", "")), and setuptools 82.0.0 removed pkg_resources. So ec create, ec dev and ec deploy all fail the same way.
2. Fix: pin setuptools below 81 (tested)
$ pip install "setuptools<81" # gave 80.10.2
$ ec --help
embedchain/utils/cli.py:6: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
import pkg_resources
Usage: ec [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
create
create-app
deploy
dev
install-reqs
start
$ ec create --help
Usage: ec create [OPTIONS] [EXTRA_ARGS]...
Options:
--template TEXT The template to use.
--help Show this message and exit.
We ran the second command with PYTHONWARNINGS="ignore:pkg_resources is deprecated as an API", which hides the harmless pkg_resources is deprecated warning. We did not run ec create itself or deploy an app.
3. The Python API is not affected
Only the CLI imports pkg_resources. On setuptools 84.2.1:
$ cat b4.py
from embedchain import App
print(App.__name__)
$ python b4.py
App
Do not wait for an upstream fix. In May 2026 the mem0 repository moved embedchain out to mem0ai/embedchain-archive, and PyPI has nothing newer than 0.1.128. For new projects the maintainers point to mem0; for an existing embedchain app, keep the setuptools pin.
Related: No module named 'pkg_resources' (general fix) · Open Interpreter (same cause) · nnictl (NNI).
Frequently asked questions
Does from embedchain import App fail too?
No. In our test it worked on setuptools 84.2.1; only the ec CLI imports pkg_resources.
Will embedchain get a fixed release?
Unlikely. The code was moved to mem0ai/embedchain-archive in May 2026, and 0.1.128 is the last release on PyPI.
Written with AI assistance. Measured on 2026-10-24 on Linux with embedchain 0.1.128, langchain 0.3.30, chromadb 0.5.23, CPython 3.11.17, setuptools 80.10.2 and 84.2.1. Output pasted unedited except shortened paths and one cut traceback. PlainTables is our extension; embedchain is free.