Hello all - I have a similar issue that is hard to make sense to me.  
1. I installed Python 3.9.13 and then installed ArcGIS API for python by using pip install arcgis
2. the test codes works fine with python environment
3, but the same codes does not work in visual studio 2022, saying No module named 'arcgis.gis'; 'arcgis' is not a package
4.the same test codes work in python interpreter in visual studio 2022
5. Had used the same way installed many other packages such as Qt, pandas, all works fine in Visual Studio 2022.  But ArcGIS API for Python failed.
Really appreciate any idea.
Thanks,
Shquing
 works in python interpreter in visual studio 2022
works in python interpreter in visual studio 2022
 works in python interpreter
works in python interpreter does not work in visual studio 2022
does not work in visual studio 2022