azure-functions-core-tools: ImportError: cannot import name 'cygrpc' - when using 32-bit python

func --version: 2.7.1480 Windows: 10 VScode: 1.36.1 Python (Anaconda): 3.6.8 Region: Europe

I am trying to create a simple Python function in VScode and would like to test it locally. However, when running func host start, I get the following error:

[30-07-2019 15:36:29] Starting language worker process:python  "...\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py" --host 127.0.0.1 --port 63313 --workerId a1454793-25c8-4277-9a29-867ec0551e05 --requestId 2bcba29b-78ed-429f-9bdb-794a022c08b3 --grpcMaxMessageLength 134217728
[30-07-2019 15:36:29] python process with Id=13728 started
[30-07-2019 15:36:29] Traceback (most recent call last):
[30-07-2019 15:36:29]   File "...\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\worker.py", line 1, in <module>
[30-07-2019 15:36:29]     from azure.functions_worker import main
[30-07-2019 15:36:29]   File "...\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\deps\azure\functions_worker\main.py", line 7, in <module>
[30-07-2019 15:36:29]     from . import dispatcher
[30-07-2019 15:36:29]   File "...\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\deps\azure\functions_worker\dispatcher.py", line 14, in <module>
[30-07-2019 15:36:29]     import grpc
[30-07-2019 15:36:29]   File "...\AppData\Roaming\npm\node_modules\azure-functions-core-tools\bin\workers\python\deps\grpc\__init__.py", line 23, in <module>
[30-07-2019 15:36:29]     from grpc._cython import cygrpc as _cygrpc
[30-07-2019 15:36:29] ImportError: cannot import name 'cygrpc'

_cpython directory contains the following:

__init__.py
__pycache__/
_credentials/
_cygrpc/
cygrpc.cp36-win_amd64.pyd*

My function is a simple BlobTrigger:

import logging
import azure.functions as func

def main(myblob: func.InputStream):
    logging.info(f"Python blob trigger function processed blob \n"
                 f"Name: {myblob.name}\n"
                 f"Blob Size: {myblob.length} bytes")

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (12 by maintainers)

Most upvoted comments

Issue resolved by using 64-bit python. I did the same as @jameseleach.

Thank you for your help @maiqbal11! It would be great, if an error was given when using 32-bit python. Perhaps it should also be noted in the documentation to make it more clear.

@kajwanr, @jameseleach, could you check your Python version to see if it is 32-bit or 64-bit? The library in question is built for 64-bit Python and will not work with 32-bit.