0

I'm trying to connect with SAP Hana using python on Anaconda.

The SAP team has already given me the data to connect, but every time I try to run the code it simply loads for two seconds and then shows a pop up saying that "Python has stopped working", then it kills my kernel and restart it.

I can't figure out why this is happening because it doesn't show a proper error message, only crashes and that it.

I'm following the instructions from the SAP developers page and I'm on step 3 sub-topic 2 https://developers.sap.com/tutorials/hana-clients-python.html

See below my few lines of code.

from hdbcli import dbapi
conn = dbapi.connect(
    address="awsddb01ler.com",
    port=30044,
    user="MyUser",
    password="MyPassword",
    ENCRYPT=True,
    sslValidateCertificate=False)

If anyone has an idea of why this is happening or how can I can correct it, please share it!

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
  • 1
    And did you follow the first steps too? (required software, 64bits, etc.?) – Sandra Rossi Sep 28 '20 at 18:00
  • Yes, I've been working with Python for something like 2 years, and about the hdbcli package I downloaded and imported it before trying to create the connection – Rafael Cordeiro Sep 28 '20 at 18:09
  • 1
    when you write "it crashes" does this mean the python interpreter program aborts? If so, which python interpreter are you using (cPython, PyPy, something else)? And what OS platform are you using? – Lars Br. Sep 29 '20 at 04:18
  • try to [trace](https://pymotw.com/2/trace/) the script to find out which piece of source is causing the crash – Suncatcher Sep 29 '20 at 11:31

1 Answers1

0
  1. Check that you have the correct packages in the correct versions. This is sometimes tricky with SAP. Check also https://tools.hana.ondemand.com/#hanatools

  2. As explained use trace to find the cause of the crash

  3. Check your settings. sslValidateCertificate is typcially true, if you are in a corporate environment or use Hana Cloud.

breadcrumb42
  • 165
  • 1
  • 8