Skip to Content

HANA database service on cloud foundry with python does not work

Hi,

I am very new to cloud foundry and python and want to try the tutorial from https://help.sap.com/viewer/65de2977205c403bbc107264b8eccf4b/Cloud/en-US/0a99ed7085b8447cb303c43253f2c704.html

to build a python app using the HANA database service.

However, after following the steps in the tutorial the app does not start and throws an error like:

File "server.py", line 4, in

from hdbcli import dbapi

ModuleNotFoundError: No module named 'hdbcli'

I had downloaded th XS_PYTHON and extracted it to a directory . Then the download command was issued as in the tutorial

pip download -d vendor -r requirements.txt –-find-links sap_dependencies

The vendor directory then looks like

What am I missing ?

any help is appreciated.

unbenannt.png (29.7 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Mar 09, 2018 at 08:44 AM

    Hi,

    finally got it.

    The files for other platforms are to be included ( hdbcli-2.3.14-cp36-cp36****.whl) in the vendor directory and the requirements.txt has another line with "hdbcli==2.3.14".

    Add a comment
    10|10000 characters needed characters exceeded

    • hello Marcus,

      I have followed the exact same process but still i am facing the same error :

      2018-03-31T15:08:53.27+0530 [STG/0] ERR Could not find a version that satisfies the requirement hdbcli==2.3.14 (from -r /tmp/contents463332238/deps/0/requirements.txt (line 3)) (from versions: ) 2018-03-31T15:08:53.27+0530 [STG/0] ERR No matching distribution found for hdbcli==2.3.14 (from -r /tmp/contents463332238/deps/0/requirements.txt (line 3)).

      waiting eagerly for reply.

      Regards,

      Navin

  • Posted on Mar 09, 2018 at 08:43 AM

    Hi,

    finally got it.

    The files for other platforms are to be included ( hdbcli-2.3.14-cp36-cp36****.whl) in the vendor directory and the requirements.txt has another line with "hdbcli==2.3.14".

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 23, 2018 at 03:50 PM

    Hi Marcus,

    I have a similar issue. Many dependencies in the vendor folder. It looks like not all of them are uploaded. The installation fails with:

    No matching distribution found for hdbcli==2.3.14 (from -r /tmp/contents253433951/deps/0/requirements.txt (line 3))
    pip install has failed. You have a vendor directory, it must contain all of your dependencies.

    Do you have any idea why the dependency can't be resolved?

    Thank you and best regards

    Raphael

    Add a comment
    10|10000 characters needed characters exceeded

    • I got a workaround:

      Just copy the files for a py-version to the 'vendor' folder. Within the requirements-file 'hdbcli' would be enough. Then just start the 'cf push'.

      I think it's not the complete solution, but the 'pip install..' didn't worked for me.

      And on this way I got it working. I'm open for better solutions..

  • Posted on Jul 17, 2020 at 05:19 AM

    I had the same issue. You can use the pip install hdbcli directly in the vendor folder, it will automatically download the whl file and while deployment, those files will be detected as well.

    >> pip install hdbcli (directly in the vendor folder)

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.