0

I'm using ubuntu and trying to connect MSSQL server from python with pyodbc. I'm using pycharm professional. I'm trying to connect to sql server but I'm getting

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

Here is my code:

 def read_data(self):
    conn = pyodbc.connect('Trusted_Connection=yes', driver='FreeTDS', TDS_Version=7.3,    server='XXXXXXXXXX/SQL2014',
               port= 1433, database = 'YYYY')

I researched from the documents, I've already installed odbc and freetds.

Igor F.
  • 2,649
  • 2
  • 31
  • 39
Beyza
  • 149
  • 1
  • 11
  • Could it help? https://stackoverflow.com/questions/28566121/pypyodbc-cant-open-lib-freetds-file-not-found-error-when-trying-to-conne – uhetz Mar 09 '20 at 10:28
  • Actually it didn't work. I'm trying to connect with pymssql now. I haven't met any problem with the connection when I'm using windows. But I'm using ubuntu for a short time and I couldn't connect since 5 hours. I tried many things, now I2m installing sql server to ubuntu. – Beyza Mar 09 '20 at 10:55
  • Have you checked the [pyodbc wiki](https://github.com/mkleehammer/pyodbc/wiki/Connecting-to-SQL-Server-from-Linux)? – Gord Thompson Mar 09 '20 at 11:06
  • Yes but I didn't understand that where I'll create my text file. In pycharm or a tet file in anywhere? – Beyza Mar 09 '20 at 11:15
  • @Beyza - The text file is temporary. It can reside in any folder where you have read/write access, and it can be created with any text editor, even a console-based tool like vim or nano. (Also, remember to use "@..." on your reply comments so the person to whom you are replying gets notified.) – Gord Thompson Mar 09 '20 at 11:35

1 Answers1

0

My problem is solved. The source of my problem was my local db settings. Thanks for your comments.

Beyza
  • 149
  • 1
  • 11