Installing SQLAlchemy in Consumption plan
See original GitHub issueRuntime:
Resource: Azure Function Type: functionapp,Linux
Libraries:
- Azure Functions version: 1.0.7
- Func version: 2.7.1948
Description
Having sqlalchemy in my requirements.txt produces the following when I build the function app:
- running
--build local
errors with the following:
ERROR: cannot install SQLAlchemy-1.3.12 dependency: binary dependencies without wheels
are not supported when building locally. Use the "--build remote" option to build
dependencies on the Azure Functions build server, or "--build-native-deps" option
to automatically build and configure the dependencies using a Docker container. More
information at https://aka.ms/func-python-publish
- running
--build remote
appears to succeed, but running an endpoint results in aModuleNotFound: sqlalchemy
error in the logs - running
--build-native-deps
appears to succeed, but running an endpoint results in aModuleNotFound: sqlalchemy
error in the logs
SQLAlchemy doesn’t yet issue wheels, and the build code seems to rely on there being a wheel available.
I think SQLAlchemy does some C compilation when it’s built, although I can’t actually remember, but according to the error message I get with --build local
, either of these options should work. And neither of them errors. But in that case - why isn’t SQLAlchemy available to the function app?
Issue Analytics
- State:
- Created 4 years ago
- Comments:15 (5 by maintainers)
Top Results From Across the Web
How To Install SQLAlchemy - Liquid Web
First, let's look at installing the software within a Python virtual environment. It's best that we create a virtualenv (or venv depending on ......
Read more >How to Install SQLAlchemy in Python in Windows?
Installing SQLAlchemy on Windows using Conda: ... be done through conda, open up the Anaconda Powershell Prompt and use the below command:
Read more >How to Install sqlalchemy in Python? - Finxter
Type “ pip install sqlalchemy ” (without quotes) in the command line and hit Enter again. This installs sqlalchemy for your default Python...
Read more >Download - SQLAlchemy
License. SQLAlchemy is covered by the MIT License. Version Numbering Scheme. All projects within the SQLAlchemy Organization use the same version numbering ...
Read more >SQLAlchemy - PyPI
pip install SQLAlchemy ... Don't use an ORM if the problem doesn't need one. ... cache query plans effectively and making SQL injection...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So, it boils down to Linux Consumption plans not supporting installation from
requirements.txt
. The package needs to come with all dependencies included. So, you basically have to usefunc
to resolve the dependencies locally and prepare everything. Run:but stop it at:
Then you can zip up the files, making sure to include the generated
.python_packages
folder as part of your zip package, as that contains all the dependencies.I would like to reopen this as I’m having the following issue now when running the Function (with the correct flags applied by my patch to the terraform provider and confirmed within the App Settings). Note that my requirements.txt includes the required eventhub (
azure-eventhub==1.3.*
):