Below is the error when i try to create virtual env from the function(voicetotext) folder,
root@a8686ca40:/home/site/wwwroot/voicetotext# python -m virtualenv myenv
usage: virtualenv [--version] [--with-traceback] [-v | -q] [--app-data APP_DATA] [--reset-app-data]
[--upgrade-embed-wheels] [--discovery {
builtin}] [-p py] [--creator {builtin,cpython3-posix,venv}] [--seeder {app-data,pip}] [--no-seed]
[--activators comma_sep_list] [--clear] [--system-site-packages] [--symlinks | --
copies] [--no-download | --download] [--
extra-search-dir d [d ...]] [--pip version] [--setuptools version] [--wheel version] [--no-pip]
[--no-setuptools] [--no-wheel] [--no-periodic-update] [--symlink-app-data] [--prompt
prompt] [-h]
dest
virtualenv: error: argument dest: the destination . is not write-able at
/home/site/wwwroot/voicetotext
SystemExit: 2
Please guide on how to import modules to azure functions(python)
Initial error for function is "no module named speech_py_impl"... Read from internet that we should add package "libasound2".. When i try to add this module through kudu's, i am struck. If there is any alternative also please advise. Thanks!
It is not recommended to use kudu to install your modules when using Python Azure Functions. That environment is not always persistent, and you may loose changes. Additionally, module installed through kudu may not be accessible to your function code.
The proper approach is to develop locally and then publish to Azure. To use custom modules such as the one you referred, you need a requirements.txt
file in your function app root directly listing all your dependencies. When developing from a local environment with all the dependencies installed, you can run pip freeze > requirements.txt
. Once you are ready to develop, you can use the VS Code extension for Azure Functions or the azure-functions-core-tools
CLI. For more information on this process, please follow the development guide -- https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python#package-management