I'm currently working through "Deep Learning and the Game of Go", and many of the files it has me create start with statements like this:
from dlgo.agent.base import Agent
However, when I attempt to run this in VSCode, it gives me the following error:
(manimations) β Python git:(main) β /Users/billshillito/Documents/Python/.venv/bin/python /Users/billshillito/Documents/Python/dlgo/agent/naive.py
Traceback (most recent call last):
File "/Users/billshillito/Documents/Python/dlgo/agent/naive.py", line 2, in <module>
from dlgo.agent.base import Agent
ModuleNotFoundError: No module named 'dlgo'
If I change this to just from base import Agent because my naive.py lives in the same folder as base.py. However, I have the hunch I shouldn't be changing the code as it's written in the book.
For reference, I'm using VSCode for Mac (Tahoe 26.1), with the Python extension, and I have a keyboard shortcut that just hits the "Run Python File" button at the top right. This has always worked with other more self-contained programs I write such as Project Euler, but now it's giving me this issue. What should I be doing instead?