Problems import sysidentpy package

Patrick Schneider 86 Reputation points
2021-07-07T08:46:50.47+00:00

Hello,

for a system identification I need the python package sysidentpy.
(see https://pypi.org/project/sysidentpy/)

However, the integration of the package into my Azure Function App does not want to succeed.

Following is my requirements.txt file:
azure-functions
azure-iot-hub
azure-digitaltwins-core
azure-identity
numpy==1.21.0
pandas==1.3.0
matplotlib==3.4.2
sysidentpy==0.1.5.3

The following error is issued:
0:03:13 func-PI-RnD-DEWestMid-001: [08:03:13+0000] Collecting sysidentpy==0.1.5.3
10:03:13 func-PI-RnD-DEWestMid-001: [08:03:13+0000] Using cached sysidentpy-0.1.5.3.tar.gz (21.5 MB)
10:03:14 func-PI-RnD-DEWestMid-001: ERROR: Command errored out with exit status 1:
10:03:14 func-PI-RnD-DEWestMid-001: command: /tmp/oryx/platforms/python/3.9.0/bin/python3.9 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-6gu_bg92/sysidentpy/setup.py'"'"'; file='"'"'/tmp/pip-install-6gu_bg92/sysidentpy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r
10:03:14 func-PI-RnD-DEWestMid-001: '"'"', '"'"'
10:03:14 func-PI-RnD-DEWestMid-001: '"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-_3sq2mjs
10:03:14 func-PI-RnD-DEWestMid-001: cwd: /tmp/pip-install-6gu_bg92/sysidentpy/
10:03:14 func-PI-RnD-DEWestMid-001: Complete output (1 lines):
10:03:14 func-PI-RnD-DEWestMid-001: numpy is required during installation
10:03:14 func-PI-RnD-DEWestMid-001: ----------------------------------------
10:03:14 func-PI-RnD-DEWestMid-001: ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

The following article notes that this may be related to the Python version used. According to the article, I need Python version 3.8 and numpy version 1.19.3.
(see https://github.com/wilsonrljr/sysidentpy/issues/39)

I have also tried it with the mentioned numpy version but it did not work either.

My Function App is implemented in Linux. I had set the python version to 3.8 or 3.9 (I am not sure).

Is there a way to check the specific Version (Not whether it is only 3.x but whether it is really 3.8 or 3.9)
And is there a way to set the existing function app to 3.8?

Are there any other comments which could solve the problem.

I hope someone can help me further.

With best regards
Patrick

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,393 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. MayankBargali-MSFT 69,581 Reputation points
    2021-07-13T07:35:38.093+00:00

    @Patrick Schneider In scenario where the modules can be installed using pip then you can mentioned the same in your requirements.txt and those modules will get installed.

    But in cases if those module or dependencies cannot be installed using pip then you need to use build native dependencies or enable remote build.
    You can refer to python troubleshooting document for more details.

    If it works locally then you can try with build native dependencies or enable remote build.

    2 people found this answer helpful.

  2. Pierre-Luc Giguere 1,076 Reputation points
    2021-07-07T20:45:08.96+00:00

    Hi Patrick,

    You can check the exact version by adapting the following command :

    az functionapp config show --name thisisaname --resource-group rg-testfunction --query linuxFxVersion --output tsv  
    

    You have to replace the --name and --resource-group for the name of the functionapp and its resource-group respectively.

    The Python version is set when the function app is created and can't be changed.

    Source: https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference-python?tabs=application-level#python-version

    1 person found this answer helpful.
    0 comments No comments

  3. Patrick Schneider 86 Reputation points
    2021-07-08T06:51:56.32+00:00

    Hello PierreLucGiguere-5297,

    Thank you very much, that has already helped a lot.

    The current App had the python version 3.9. I pulled up the Function App again and deposited the corresponding python version 3.8.

    However, the problem remains the same, the package sysidentpy still can not be installed. (Same error message)

    Can you help me further why the installation fails?