AnswerDotAI / AnswerDotAI/nbdev

Update fastcore>=1.5.27, nbdev broken on conda install

Open
#1,470 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Jupyter Notebook
Stars
5.3k
Forks
513
Avg merge
2d 30m
Merged PRs (30d)
8

Description

Create a new environment in conda and try to create new repo:
```bash
conda create -n test_name python=3.12 nbdev -y
conda activate test_name
mkdir test
cd test
nbdev_new
```

You will get an error:
```
nbdev_new
Traceback (most recent call last):
File "/Users/eric/micromamba/envs/test_name/bin/nbdev_new", line 6, in
from nbdev.cli import nbdev_new
File "/Users/eric/micromamba/envs/test_name/lib/python3.12/site-packages/nbdev/cli.py", line 11, in
from .processors import *
File "/Users/eric/micromamba/envs/test_name/lib/python3.12/site-packages/nbdev/processors.py", line 23, in
from execnb.shell import *
File "/Users/eric/micromamba/envs/test_name/lib/python3.12/site-packages/execnb/shell.py", line 10, in
from fastcore.ansi import ansi2html
ModuleNotFoundError: No module named 'fastcore.ansi'
(test_name)
```

Temp solution is to install fastcore to the latest:
```bash
pip install -U fastcore
Requirement already satisfied: fastcore in /Users/eric/micromamba/envs/test_name/lib/python3.12/site-packages (1.5.29)
Collecting fastcore
Using cached fastcore-1.7.20-py3-none-any.whl.metadata (3.5 kB)
Requirement already satisfied: packaging in /Users/eric/micromamba/envs/test_name/lib/python3.12/site-packages (from fastcore) (24.1)
Using cached fastcore-1.7.20-py3-none-any.whl (83 kB)
Installing collected packages: fastcore
Attempting uninstall: fastcore
Found existing installation: fastcore 1.5.29
Uninstalling fastcore-1.5.29:
Successfully uninstalled fastcore-1.5.29
Successfully installed fastcore-1.7.20
(test_name)
```
After update to latest fastcore, nbdev_new works fine. I suggest just increasing the fastcore requirement to the version that stops breaking nbdev_new.

Thanks!

Contributor guide

Open the contributing guide

Research direction

Reproduce the failure with the provided conda commands, then inspect nbdev's dependency declarations for the fastcore minimum version. Update that requirement to a compatible version and rerun nbdev_new in a fresh environment to confirm the import error is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, python
Domain
cli, devtools
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.