Suddenly can't build and deploy Python Azure Function app

3005
7
Jump to solution
08-22-2022 06:07 PM
RogerAsbury
Occasional Contributor

Have one of those cases of "It worked on Friday and now it doesn't on Monday." No code changes that I am aware of, but now when I attempt to build an Azure Function app that uses the ArcGIS API for python, I am getting errors. Namely: 

gssapi/raw/misc.c:42:20: fatal error: Python.h: No such file or directory
#include "Python.h"
                       ^
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Failed building wheel for gssapi
ERROR: Could not build wheels for gssapi which use PEP 517 and cannot be installed directly
 
This only occurs if ArcGIS is in the requirements.txt of the function app, which, of course, it needs to be for me to be able to access ArcGIS online resources with the function app. Again, no code changes were made over the weekend. If I remove ArcGIS from the requirements.txt, the app builds fine and deploys to the function app server, but errors out when any ArcGIS functionality is called. That's expected since requirements.txt lists dependencies, and if it's not listed it's not there.
 
I'm using Visual Studio Code on a Windows PC to build this app. Python 3.9.7 is installed, and like I said, everything worked fine until this morning. Currently clueless and frustrated.
--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
Tags (3)
0 Kudos
1 Solution

Accepted Solutions
ShaunWalbridge
Esri Regular Contributor

I believe this is related to the upstream python-gssapi library issue reported here:

https://github.com/pythongssapi/python-gssapi/issues/299

If you try again, it may resolve itself as the 1.8.1 release should correctly state its own requirements. You could also try downgrading to the API 2.0.0 release which doesn't have a requirement on `requests-gssapi`.

Cheers, Shaun

View solution in original post

0 Kudos
7 Replies
ShaunWalbridge
Esri Regular Contributor

I believe this is related to the upstream python-gssapi library issue reported here:

https://github.com/pythongssapi/python-gssapi/issues/299

If you try again, it may resolve itself as the 1.8.1 release should correctly state its own requirements. You could also try downgrading to the API 2.0.0 release which doesn't have a requirement on `requests-gssapi`.

Cheers, Shaun

0 Kudos
RogerAsbury
Occasional Contributor

Thanks much. Seemed to have to go back to ArcGIS API 1.9.1 to get things to work again, but at least it's working now. When I checked the gssapi version, it was 1.8.1 that was being loaded and causing the error, so not sure what's up with that.

Again, thanks for the help. 

--
Roger Asbury
Analyst/Programmer - Fairbanks North Star Borough
0 Kudos
ShaunWalbridge
Esri Regular Contributor

Glad you got something working. It looks like its a specific design choice of the gssapi package to not include Linux wheels: https://github.com/pythongssapi/python-gssapi/issues/200

I've created an internal issue for the Python API team to track this as a design issue with the addition of GSS as a dependency.

0 Kudos
CamMuller
Esri Contributor

Thank you for logging this internally @ShaunWalbridge, does the team have any timeline against this?

I have encountered the issue when deploying a function today and also had to define the API version at 1.9.1 in order for the deployment to succeed.

Thank you.

InfodimGIS
New Contributor II

I can also confirm I had the same issue today and arcgis 1.9.1 is the version that did the trick.

0 Kudos
TedChapin
Occasional Contributor III

I am also having this same error, but installing arcgis api 1.9.1 is not working. Will not deploy if I include arcgis.

 

0 Kudos
TedChapin
Occasional Contributor III

Going back to arcgis 1.9.1 does work after all.
Have to put "arcgis==1.9.1" in the requirements.txt file, not just "arcgis"
Got it to work!

0 Kudos