The Pycharm IDE has an issue with what they call "error detection" in Python.
PyCharm also helps you with errors. If you make a mistake in the code,
this word will be indicated by red underlining. Hovering over this
word with the mouse displays a tooltip with details.
I switched to Visual Studio Code and everything was fine. This is called source code linting, so Visual Studio Code is using the industry standard term. It appears Pylint is the extension that is handling this correctly.
from redcap import Project
import redcap.Project
Rather than having the developers of the Visual Studio Code IDE be responsible for an issue like this (if it really is one), the developer of the extension is instead. The developers of PyCharm decided to make this their responsibility because the source code linting (what they are calling error detection in Python) is built into the IDE itself, but it failed.
The community of Visual Studio Code is much larger, so I switched to Visual Studio Code.