VS Code Intellisense Not Working for Python gRPC

638 Views Asked by At

Is there anything specific that needs to be done to get VS Code's intellisense working for classes auto-generated by the gRPC compiler in Python? I ran the compile command:

python -m grpc_tools.protoc -I../../pb --python_out=. --grpc_python_out=. ../../pb/demo.proto

and then imported the generated class. When I'm trying to access the request object in one of the methods, autocompletion doesn't work and I'm unable to see the properties of the incoming request which makes development very tedious as I keep having to switch back to the proto file to check the names of properties.

1

There are 1 best solutions below

1
Arthur Smirnov On

You should check your Python Interpreter path. To select a specific environment, use the Python: Select Interpreter command from the Command Palette.

https://code.visualstudio.com/docs/python/environments#_work-with-python-interpreters