1
votes

I'm trying to set up pyodbc on a mac so I can run python scripts to talk to a filemaker database.

I am running python2.7

I have installed ODBC Manager, and the Filemaker odbc client driver. I have tested this connection and it connects fine.

However when I run the python script i get this error

pyodbc.Error: ('01000', u"[01000] [unixODBC][Driver Manager]Can't open lib 'FileMaker ODBC' : file not found (0) (SQLDriverConnect)")

c = "DRIVER={FileMaker ODBC};SERVER=localhost:2399;DSN=DB;UID=user;PWD=pass;Trusted_Connection=yes" 
con = pyodbc.connect(c)

Any help would be really appreciated.

2
Make sure the user "user" has ODBC extended privilege in FileMakerNicolai Kant
Thanks, the user is admin and has full access. Unfortunately still the same problem.Richard

2 Answers

4
votes

Problem fixed. My odbc.ini file was in the wrong place.

I ran the command

odbcinst -j

unixODBC 2.3.5 DRIVERS............: /usr/local/etc/odbcinst.ini SYSTEM DATA SOURCES: /usr/local/etc/odbc.ini FILE DATA SOURCES..: /usr/local/etc/ODBCDataSources

and moved the odbc.ini file from /Library/ODBC/odbc.ini to /usr/local/etc/odbc.ini

problem solved.

1
votes

Other options:

PyFileMaker - using XML API https://github.com/aeguana/PyFileMaker

bBox - plugin https://bbox.beezwax.net/products/bbox

Python-fmrest - using FM Data API https://github.com/davidhamann/python-fmrest