Python 3.12 No module named 'pkg_resources'
Python 3.12.4 on Mac
➜ pip install nbdev
➜ nbdev_new
Traceback (most recent call last):
File "/Users/user/Documents/Code/Shell/NBDev_Tutorial/venv/bin/nbdev_new", line 5, in <module>
from nbdev.cli import nbdev_new
File "/Users/user/Documents/Code/Shell/NBDev_Tutorial/venv/lib/python3.12/site-packages/nbdev/__init__.py", line 3, in <module>
from .doclinks import nbdev_export
File "/Users/user/Documents/Code/Shell/NBDev_Tutorial/venv/lib/python3.12/site-packages/nbdev/doclinks.py", line 17, in <module>
import pkg_resources,importlib
ModuleNotFoundError: No module named 'pkg_resources'
Fix required mentioned in #1392 and in issue #1397 raised a fix that was closed?
Non-starter trying to follow the tutorial.
Hi @fanuch, the issue is kind of stuck till the issue gets resolved in the fastcore library on which nbdev depends. A temporary solution for now would be to use python 3.11 if possible.
install setuptools
Probably should just add setuptools to the dependencies of nbdev, at least until this issue is addressed properly. I and many others use uv which doesn't install setuptools in the venv so this issue is readily apparent.
Looks like this happened but got reverted https://github.com/fastai/fastcore/pull/544