Azure-functions-core-tools: Packages with non-binary wheels (e.g. pyodbc) not supported in CLI?

Created on 19 Aug 2018  路  6Comments  路  Source: Azure/azure-functions-core-tools

I've added the pyodbc package to my requirements.txt. When I try to deploy the function app using
func azure functionapp publish <app-name>
I get:
``
...
Successfully built pyodbc

There was an error restoring dependencies. Could not find a version that satisfies the requirement pyodbc==4.0.24 (from versions: )
No matching distribution found for pyodbc==4.0.24
ERROR: binary dependencies without wheels are not supported
``

I understand that this seems to be by design while this is in preview, given that in
https://github.com/Azure/azure-functions-core-tools/blob/master/tools/python/packapp.py
we have:
def build_binary_wheel(name, version, args, dest): die('binary dependencies without wheels are not supported')

Is there any workaround other than using Docker?
I tried compiling my own pyodbc wheel using Ubuntu but it didn't work.

Most helpful comment

with the change in 441217c, you can now run with

--build-native-deps --additional-packages "python3-dev libevent-dev unixodbc-dev"

All 6 comments

We鈥檙e planning to have two alternate paths here:

  1. Use docker to build native dependencies. This is supported by the core tools if you use the 鈥揵uild-native-deps option with the func publish command. Currently, there鈥檚 a bug in this implementation - fix https://github.com/Azure/azure-functions-core-tools/pull/638 is scheduled for the next release.

  2. As part of the docs, we are planning to provide a sample Travis script to build the final deployment package on a linux based CI server. See https://github.com/Azure/azure-functions-python-worker/issues/182 for more details.

Since python is still in alpha, we're looking for feedback around this feature. Please feel free to comment on the solution above to let us know if this does/ does not work for you.

I didn't know that option #1 was available for Python and I think that would work the most frequent cases. Do we already have documentation around it?

Option #1 seems to be much simpler than option #2 as there's a lot that can be done in Azure without having to involve Travis CI. Will there be cases in which #2 is the only possible option?

I didn't know that option #1 was available for Python and I think that would work the most frequent cases. Do we already have documentation around it?

There are no docs at the moment but here's the command you need to run -

func azure functionapp publish <app name> --build-native-deps --force

Option #1 seems to be much simpler than option #2 as there's a lot that can be done in Azure without having to involve Travis CI. Will there be cases in which #2 is the only possible option?

Yes, there are two challenges with option #1 -

  • You're required to have docker installed locally as a prerequisite for publishing to Azure
  • Significantly longer publishing time.

Thanks. This is very helpful. I think that will solve a lot of cases, including mine. Just having the ability of using Python in Azure Functions is great for a lot of Data Science applications.

At some point, I expected to be able to simply deploy from Azure Continuous Deployment from GitHub (as we can do with Azure Functions v1), but I guess this is not in the short-term plan, correct?

At some point, I expected to be able to simply deploy from Azure Continuous Deployment from GitHub (as we can do with Azure Functions v1), but I guess this is not in the short-term plan, correct?

I don't believe we have any plans for integrated CI for Linux deployments at the moment. Adding @dariagrigoriu to comment.

with the change in 441217c, you can now run with

--build-native-deps --additional-packages "python3-dev libevent-dev unixodbc-dev"
Was this page helpful?
0 / 5 - 0 ratings