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.

5
  • Could it help? stackoverflow.com/questions/28566121/… Commented Mar 9, 2020 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. Commented Mar 9, 2020 at 10:55
  • Have you checked the pyodbc wiki? Commented Mar 9, 2020 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? Commented Mar 9, 2020 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.) Commented Mar 9, 2020 at 11:35

1 Answer 1

0

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.