What configuration changes are needed in VSCode (or in my project layout) to make Pylance and Pylint recognize the installed cowsay package and its members? Is there a best practice for structuring local packages alongside third-party libraries so that both analysis engines pick them up correctly?
I’ve created a Python 3 virtual environment in VSCode (using python -m venv venv at the project root), installed the cowsay library via pip, and selected the interpreter from venv. However, in my source file I see:
Import "cowsay" could not be resolved PylancereportMissingImports
Module 'cowsay' has no 'cow' member PylintE1101:no-member
Code:
import cowsay
import sys
if len(sys.argv) == 2:
cowsay.cow("Hello there, " + sys.argv[1])
This happens even though running the script with:
./venv/bin/python3.13 packages/say.py carl
prints the correct output:
./venv/bin/python3.13 packages/say.py carl
_________________
| Hello there, carl |
=================
\
\
^__^
(oo)\_______
(__)\ )\/\
||----w |
|| ||
Project structure:
project-root/
├── packages/
│ └── say.py
├── venv/ ← virtual environment



python.analysis.extraPaths? See github.com/microsoft/pylance-release/blob/main/docs/settings/…