0

I'm trying to debug my azure function, with python, in visual studio code. However, when I press F5, I continue to have this problem: connect ECONNREFUSED 127.0.0.1:9091. 

So I noticed that I got this errors on the terminal: 

     1- cannot import name 'cygrpc' from 'grpc._cython'. 

     2- Also, when I press F5, I noticed that my azure function is using python version 3.7.2, but my IDE is using python version 3.9.2

Can someone help me solve this problem please?

8
  • can you get the version of grcpio with pip show grpcio ? Commented Mar 24, 2021 at 12:27
  • also you can change the python interpreter version in VS Code when you click on python version in bottom left corner and choose the right version from the promt window. Commented Mar 24, 2021 at 12:31
  • @BijayRegmi I got version:1.23.0 Commented Mar 24, 2021 at 12:33
  • can you also check pip version with pip --version to make sure you use same python interpreter Commented Mar 24, 2021 at 12:34
  • I got version:21.0.1 Commented Mar 24, 2021 at 12:35

1 Answer 1

1

cyrgrpc is the module containing the gRPC C extension -- native code that must compile against the API and ABI of a specific Python interpreter version. This seems to come down in a mismatch between the Python version of your package manager (whether it's pip or poetry or something else) and the runtime interpreter being used by your IDE.

Take a look at the installable grpcio wheels here. All except the source distributions (which you probably don't want) include a substring of the filename indicating which version of CPython it was compiled against. For example, grpcio-1.36.1-cp39-cp39-manylinux2010_x86_64.whl is a Python 3.9 wheel.

You haven't supplied the particulars of how the package was installed or the relationship between your IDE's runtime interpreter and your package manager, so I can't help you much there. But you need to ensure that the versions match between the two.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.