I am using Python 2.7 and have a module which cannot install via pip. I have created a wheel using these instructions and uploaded the wheel into a wheelhouse directory in the function.
And here is the wheel in that directory:
I've added a requirements.txt to the root of the function with the following content:
If I run d:\python27\python.exe -m pip install -r requirements.txt from the Kudu console I see the following error:
d:\python27\python.exe -m pip install -r requirements.txt
error: Microsoft Visual C++ 9.0 is required (Unable to find vcvarsall.bat). Get it from http://aka.ms/vcpython27
But I don't think the above is a fruitful path to follow as I won't have the rights I need to get vc++ installed methinks. And my understanding was that if the wheel were being used, that it shouldn't need a compile at this juncture.
I have added a import yara statement to the top of my Python script. If I try to save/run the Function from the Azure Portal, I see the following error in the logs:
2017-01-06T21:03:22.454 Exception while executing function: Functions.buildRule. Microsoft.Azure.WebJobs.Script: Traceback (most recent call last):
File "D:\home\site\wwwroot\buildRule\run.py", line 2, in <module>
ImportError: No module named yara
Is there another way to bring in this dependency? Is there a way to hint to Python/Functions that I want to use the precompiled wheel?
Resolving the error "Unable to find vcvarsall.bat" requires the installation of Microsoft Visual C++ Compiler for Python 2.7 (See Details section)
Even if we were able to install this package, there are 2 issues worth noting:
Under the System Requirements section, it states,
Supported Operating System
Windows 7, Windows 8, Windows 8.1
The Azure Functions infrastructure runs on Windows Server 2012. There may still be issues during runtime.
We may engage VS team for an update, but under the Details section, it states,
"This compiler package is entirely unsupported..."
Have you tried using Python 3 to see if it will resolve the issue? Here are the instructions: https://github.com/Azure/azure-webjobs-sdk-script/wiki/Using-a-custom-version-of-Python
Great, thanks for the suggestions @tohling, I'll explore this to see if Python 3 is a solution here.
This issue was moved to Azure/azure-webjobs-sdk-script#1110