Using Python-3.11, I have a small utility package (ph_units
) that is needed by a new main package I am developing. I am using pip install -e
during development to pull in that dependency while I'm working. I am using python3 -m venv venv
to create virtual environments for all of this work.
This all works great, and any changes to the ph_units
utility package update properly in my main package as I go. Everything runs properly with no errors or issues.
Even though it runs fine, I am getting warnings in my VS-Code environment about Import could not be resolved
, and I do not get any type-hinting or autocomplete for any of my utility objects when working in my main package.
I suppose this makes sense, as the utility package is not actually in the venv/lib/python3.11/site-packages/
folder, but instead just the editable finder references are actually in there.
But I wonder if there is a known workaround to get proper VS-Code type-hints, autocomplete, and to avoid having VS-Code telling me there are errors when using the -e
flag with pip install
?
You can try to add the following codes to your settings.json
to gain intellisense:
"python.analysis.extraPaths": [
"path/to/your/package"
],