Python environment creation failed (time-series forecast)

Options
onurmtc
onurmtc Partner, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1 Partner

Hi,

When I try to set up the time series forecast plugin I get the following error. I tried to re-create and update by rebuild env but still unsolved.

Thank you for all your help already.

Screenshot 2021-05-10 103905.png

Answers

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,209 Dataiker
    edited 4:39PM
    Options

    Hi,

    Welcome to the Dataiku Community.

    Could please try to installing the following dependencies and try rebuilding the env again.

    For yum (CentOS, RHEL...):

    sudo yum install python3-devel

    For Ubuntu :

    sudo apt-get install python3-dev 

  • xavme
    xavme Dataiku DSS Core Designer, Dataiku DSS Core Concepts, Registered Posts: 8 ✭✭✭✭
    edited 4:39PM
    Options

    Hello, I also have trouble creating the environment, i've attached the error log. i've tried running

    sudo apt-get install python3-dev 

    but it is already correctly installed.

    first error in the attached file is (see complete error log in attachment):

    Collecting ujson~=1.35  Using cached ujson-1.35.tar.gz (192 kB)  ERROR: Command errored out with exit status 1:   command: /home/dataiku/dss_data/code-envs/python/plugin_timeseries-forecast_managed_2/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q4i56dyb/ujson_17183858bf5345b5b96d93bbf012e266/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q4i56dyb/ujson_17183858bf5345b5b96d93bbf012e266/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-pt2h5zzq       cwd: /tmp/pip-install-q4i56dyb/ujson_17183858bf5345b5b96d93bbf012e266/  Complete output (12 lines):  running bdist_wheel  running build  running build_ext  building 'ujson' extension  creating build  creating build/temp.linux-x86_64-3.6  creating build/temp.linux-x86_64-3.6/python  creating build/temp.linux-x86_64-3.6/libCollecting hijri-converter  Downloading hijri_converter-2.1.3-py3-none-any.whl (14 kB)Collecting korean-lunar-calendar  Using cached korean_lunar_calendar-0.2.1-py3-none-any.whl (8.0 kB)Building wheels for collected packages: ujson  Building wheel for ujson (setup.py): started  Building wheel for ujson (setup.py): finished with status 'error'  Running setup.py clean for ujsonFailed to build ujson

    do you have any idea how to solve this?

    thanks

    Xavier

  • xavme
    xavme Dataiku DSS Core Designer, Dataiku DSS Core Concepts, Registered Posts: 8 ✭✭✭✭
    Options

    Hello,

    does anyone has an idea to solve this issue?

    thanks!

    Xavier

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,209 Dataiker
    Options

    Hi Xavier,

    Looking at the error it seems like the gcc compiler is failing to install ujson.

    It could be a bug in the kernel that looks similar to :

    https://bugs.launchpad.net/ubuntu/+source/python3.6/+bug/1768644

    Suggests a workaround would be to run :

    sudo apt-get install -y dpkg-dev

    Let me know if that helps.

  • xavme
    xavme Dataiku DSS Core Designer, Dataiku DSS Core Concepts, Registered Posts: 8 ✭✭✭✭
    edited 4:39PM
    Options

    Hello @AlexT
    ,

    thank you for your answer; it really looks like the issue you're mentioning and I tried your command.

    I still have the bug, which seems to be around the build of the wheel for ujson which is failing for some reason

      Building wheel for ujson (setup.py): started  Building wheel for ujson (setup.py): finished with status 'error'  Running setup.py clean for ujson  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fdebug-prefix-map=/build/python3.7-7jazGd/python3.7-3.7.11=. -fstack-protector-strong -Wformat -Werror=format-security -g -fdebug-prefix-map=/build/python3.7-7jazGd/python3.7-3.7.11=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./python -I./lib -I/home/dataiku/dss_data/code-envs/python/plugin_timeseries-forecast_managed_5/include -I/usr/include/python3.7m -c ./python/ujson.c -o build/temp.linux-x86_64-3.7/./python/ujson.o -D_GNU_SOURCE  In file included from ./python/ujson.c:39:  ./python/py_defines.h:39:10: fatal error: Python.h: No such file or directory     39 | #include <Python.h>        |          ^~~~~~~~~~  compilation terminated.  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1  ----------------------------------------  ERROR: Failed building wheel for ujson

    (i have attached the complete error log as attachment)

    I tried your suggestion but it doesn't seem to work; any other suggestion?

    thank you, I really appreciate the help!

    Xavier

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,209 Dataiker
    Options

    Hi,

    The error "fatal error: Python.h: No such file or directory " suggests that python-devel is not installed.

    Can you try re-running :

    Ubuntu:

    sudo apt-get install python-dev
    sudo apt-get install python3-dev

    For yum (CentOS, RHEL...):

    sudo yum install python-devel
    sudo yum install python3-devel

  • xavme
    xavme Dataiku DSS Core Designer, Dataiku DSS Core Concepts, Registered Posts: 8 ✭✭✭✭
    Options

    Hello @AlexT

    they are already installed:

    sudo apt-get install python-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Note, selecting 'python-dev-is-python2' instead of 'python-dev'
    python-dev-is-python2 is already the newest version (2.7.17-4).
    0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

    sudo apt-get install python3-dev
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    python3-dev is already the newest version (3.8.2-0ubuntu2).
    0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

  • Alexandru
    Alexandru Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1,209 Dataiker
    Options

    Hi,

    So the python3-dev version is 3.8. The logs show the code env is using Python 3.6.

    Can you try installing python3.6-dev :

    sudo apt-get install -y python3.6-dev

    If that does not work you will need to add the following repository :

    sudo add-apt-repository -y ppa:deadsnakes/ppa

    If that does not resolve the issue can you please confirm :

    1) exact OS version

    2) How python 3.6 was installed

  • xavme
    xavme Dataiku DSS Core Designer, Dataiku DSS Core Concepts, Registered Posts: 8 ✭✭✭✭
    Options

    Hello @AlexT

    actually even if sudo apt-get install python3-dev was already installed, i looked on the internet for answers regarding your specific comment, and i found a solution:

    "sudo apt-get install python3.6-dev" did it!

    i'm not sure why the "sudo apt-get install python3-dev" wasn't sufficient, but I was able to build the environment successfully

    thanks a lot for helping!

    Xavier

  • murphybeck
    murphybeck Registered Posts: 1 ✭✭✭
    Options

    Most of the time these are dependency-issues. You need to install a package called python-dev. This package includes header files, a static library and development tools for building Python modules, extending the Python interpreter or embedding Python in applications. When encountering this error please note before the error it may say you are missing a package or header file — you should find those and install them and verify if it works

    For Python 2.x use:

    $ sudo apt-get install python-dev

    If you using python3, try to replace python-dev with python3-dev

    For a specific version of Python 3, replace x with the minor version in

    $ sudo apt-get install python3.x-dev

Setup Info
    Tags
      Help me…