tatornator12 / Azure-Functions-ArcGIS-Examples

0 stars 0 forks source link

Importing arcgis GIS #1

Open robeisenrich opened 3 years ago

robeisenrich commented 3 years ago

I am having issues with importing the esri packages, both from the init.py and from any modules I attempt to import from shared_code.

I have listed arcgis under requirements and also installed requirements to my local machine.

Have you noticed any issues with importing from the shared_code folder or from the init.py?

tatornator12 commented 3 years ago

@robeisenrich this is within VSCode itself? What error are you getting? Does your python environment have the arcgis package?

I have not had any issues importing within init.py. I have never tried a shared_code folder. I have heard other colleagues have specific issues with VSCode though, so maybe this is related?

robeisenrich commented 3 years ago

This is within vscode that I am getting the error.

Overall I think I need to understand the deployment process better. Would you have time for a screen share this week?

Thanks

On Mon, Jun 21, 2021 at 1:09 PM Taylor Teske @.***> wrote:

@robeisenrich https://github.com/robeisenrich this is within VSCode itself? What error are you getting? Does your python environment have the arcgis package?

I have not had any issues importing within init.py. I have never tried a shared_code folder. I have heard other colleagues have specific issues with VSCode though, so maybe this is related?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tatornator12/Azure-Functions-ArcGIS-Examples/issues/1#issuecomment-865203152, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSX35GNFJU6DUFHPZ5MMUTTT5W6LANCNFSM47BTNGUA .

tatornator12 commented 3 years ago

Maybe towards the end of the week like Thursday afternoon or sometime Friday.

robeisenrich commented 3 years ago

Apologies,

For some reason, I thought this was from my azure support case.

The function I have running is working perfect, it just spit out an error from my local machine. I have arcgis installed as well as in the requirements.txt.

Do you think this is a esri issue or a azure/vscode issue?

On Mon, Jun 21, 2021 at 3:22 PM Taylor Teske @.***> wrote:

Maybe towards the end of the week like Thursday afternoon or sometime Friday.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tatornator12/Azure-Functions-ArcGIS-Examples/issues/1#issuecomment-865285036, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSX35AFVYA7BMFLP4ES34DTT6GPDANCNFSM47BTNGUA .

tatornator12 commented 3 years ago

Haha, no worries!

I would almost lean towards VSCode as I haven't encountered any issues before. So you were able to deploy to a function app and it runs fine there, but when you try to run locally it's not working? What error is it spitting out on your local machine?

robeisenrich commented 3 years ago

On my local machine, I am getting the following. It seems like the issue is always related to the import for arcgis using 'from arcgis.gis import gis'

I have arcgis in my requirements.txt and installed in the local environment. Is there something else I need to do to doge this error?

Thanks

[image: image.png] https://github.com/Xingyixzhang/Support_Repro/tree/main/ArcGISimportRepro

On Tue, Jun 22, 2021 at 12:17 PM Taylor Teske @.***> wrote:

Haha, no worries!

I would almost lean towards VSCode as I haven't encountered any issues before. So you were able to deploy to a function app and it runs fine there, but when you try to run locally it's not working? What error is it spitting out on your local machine?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tatornator12/Azure-Functions-ArcGIS-Examples/issues/1#issuecomment-866129565, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSX35BK4ONCHP6DYRG6DALTUCZRTANCNFSM47BTNGUA .

tatornator12 commented 3 years ago

Unfortunately, it doesn't look like the screenshot came through. Could you try again?

jholycross commented 3 years ago

@robeisenrich Are you getting an error that's something like this

    [2021-06-23T21:20:02.495Z] Worker failed to function id e07d2108-a549-4a5b-9e9c-87c0bb4b5330.
    [2021-06-23T21:20:02.496Z] Result: Failure
    Exception: TypeError: 'NoneType' object is not callable
    Stack:   File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.7/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 288, in _handle__function_load_request
        func_request.metadata.entry_point)
      File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.7/WINDOWS/X64\azure_functions_worker\utils\wrappers.py", line 40, in call
        return func(*args, **kwargs)
      File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.7/WINDOWS/X64\azure_functions_worker\loader.py", line 76, in load_function
        mod = importlib.import_module(fullmodname)
      File "C:\Users\<username>\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\importlib\__init__.py", line 127, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
      File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
      File "<frozen importlib._bootstrap>", line 983, in _find_and_load
      File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
      File "<frozen importlib._bootstrap>", line 983, in _find_and_load
      File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 728, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "C:\Users\<username>\Documents\_Projects\Azure_Functions\AzureWebhook\__init__.py", line 10, in <module>
        from arcgis import GIS
robeisenrich commented 3 years ago

Good afternoon,

I am getting a similar error response. Attached is the screenshot of the error stack [image: image.png]

On Wed, Jun 23, 2021 at 5:21 PM Jeff Holycross @.***> wrote:

@robeisenrich https://github.com/robeisenrich Are you getting an error that's something like this?

[2021-06-23T21:20:02.495Z] Worker failed to function id e07d2108-a549-4a5b-9e9c-87c0bb4b5330. [2021-06-23T21:20:02.496Z] Result: Failure Exception: TypeError: 'NoneType' object is not callable Stack: File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.7/WINDOWS/X64\azure_functions_worker\dispatcher.py", line 288, in

handle__function_load_request func_request.metadata.entry_point) File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.7/WINDOWS/X64\azure_functions_worker\utils\wrappers.py", line 40, in call return func(args, *kwargs) File "C:\Program Files\Microsoft\Azure Functions Core Tools\workers\python\3.7/WINDOWS/X64\azure_functions_worker\loader.py", line 76, in load_function mod = importlib.import_module(fullmodname) File "C:\Users\AppData\Local\ESRI\conda\envs\arcgispro-py3-clone1\lib\importlib_init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 953, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in call_with_frames_removed File "C:\Users\Documents_Projects\Azure_Functions\AzureWebhook_init.py", line 10, in from arcgis import GIS

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tatornator12/Azure-Functions-ArcGIS-Examples/issues/1#issuecomment-867168029, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMSX35FJL7QTEXQWBH22NXTTUJF63ANCNFSM47BTNGUA .

jholycross commented 3 years ago

@robeisenrich Your screenshots are not coming through. Maybe it's because you're using an e-mail instead of the GitHub site? Just speculation.

Even though I can't see your error stack, if your error is similar then unfortunately neither Taylor nor I have a good answer for you. I'm having the same problem with my local Azure Functions, they crash as soon as I try to import arcgis. But they work when deployed to Azure, so it seems to be something local. I'll post here if I'm able to figure anything out, but so far neither of us have been able to come up with a solution. For some reason Taylor has no issues, while I can't get mine to work, despite us both having the same version of ArcGIS & VSCode.

jholycross commented 3 years ago

I meant to mention that I found this post which seems to be a similar issue, but still haven't resolved the problem yet. https://docs.microsoft.com/en-us/answers/questions/337455/pandas-import-causing-problems-with-azure-function.html