Problems with Python3 in connection with Firebird2.5

Asked

Viewed 555 times

3

I made this Python code (basic connection with Firebird):

import fdb

con = fdb.connect(
    host='192.168.1.17', database='/home/firebird/questor.fdb',
    user='sysdba', password='masterkey'
)

cur = con.cursor()
cur.execute("select nomeusuario from usuario")

print(cur.fetchall())

and is returning this error on the console:

Traceback (most recent call last):
  File "C:/Users/Thales/PycharmProjects/TesteBanco/main.py", line 5, in <module>
    user='sysdba', password='masterkey'
  File "C:\Users\Thales\PycharmProjects\TesteBanco\venv\lib\site-packages\fdb\fbcore.py", line 784, in connect
    load_api(fb_library_name)
  File "C:\Users\Thales\PycharmProjects\TesteBanco\venv\lib\site-packages\fdb\fbcore.py", line 220, in load_api
    setattr(sys.modules[__name__], 'api', ibase.fbclient_API(fb_library_name))
  File "C:\Users\Thales\PycharmProjects\TesteBanco\venv\lib\site-packages\fdb\ibase.py", line 1385, in __init__
    raise Exception("The location of Firebird Client Library could not be determined.")

Exception: The location of Firebird Client Library could not be determined.

Points to raise here:

I already have the Firebird2.5 Classic Server installed;

I have installed the fdb package that is at the beginning of the code; and

I looked for the solution all morning before coming to create this topic!

  • Hello Thales, have you been able to test my answer? In case I have helped you please mark it as right. If you need help I am at your disposal. Thank you!

  • 1

    In reality as you were the only one who proposed to help, and that in fact your answer is a valid answer to the problem of not finding the FDB package, I marked as right. However, in my case I was with Python3 32bits on a 64bit machine, and therefore generates the same error as if I did not have the package. Thank you anyway!

  • Hello @Thales, I’m glad you managed to solve the problem. Hug and see you next!

1 answer

1


The error that is returning:

"The location of the Firebird client library could not be determined."

Try to install the library again this way:

Enter the prompt windows command.

Enter the folder where Python is installed with the command cd.

Then type this command:

pip install fdb

Python directory must be in path windows.

  • https://pypi.org/project/fdb/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.