简体   繁体   中英

VS Code Intellisense Not Working for Python gRPC

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM