ucbds-infra / otter-grader

A Python and R autograding solution
https://otter-grader.readthedocs.io
BSD 3-Clause "New" or "Revised" License
123 stars 64 forks source link

module pkg_resources missing when you install otter-grader in a venv environment for Python 3.12+ #823

Closed trgardos closed 1 month ago

trgardos commented 1 month ago

Describe the bug If you try to run otter commands from python 3.12 venv, you'll get a "ModuleNotFoundError: No module named 'pkg_resources'". pkg_resources is part of setuptools which used to be included in new venv virtual environments prior to python 3.12, but it was removed in 3.12. The easy fix is update the installation instructions to pip install setuptools in a new venv before you pip install otter-grader.

To Reproduce

python3 -m venv .venv
source .venv/bin/activate
pip install otter-grader

Then download the tutorial, move into tutorial directory and try to run otter assign demo.ipynb dist.

Expected behavior Installation instructions are complete and otter commands run on tutorial without error.

Versions Please provide your Python and Otter versions. The Otter can be obtained using from otter import __version__ python 3.12.4 otter 5.5.0

Additional context Add any other context about the problem here.

chrispyles commented 1 month ago

Thanks for the bug report. Fixing this should be easy -- I think I just need to add setuptools to the required dependencies for Otter.