2

I am trying to get connected to my local SQL server from Google Colab Notebook, to get data for my Python program, and I tried various options but not successful.

here is my background. I did lot of work with Visual Studio, Management Studio in MS Stack. I can easily get connected in to the SQL Server - Databases and work with those.

I started learning Python, and I use Google Colab for my python scripts. There generally I got the needed libraries imported by import command.

When I execute the command import pyodbc I get an error

Then I tried !pip install pyodbc Then I get a different error.

When I serched in the web, it is saying that i need to install python, the pyodbc etc locally in my machine. Is there a way that I can connect to SQl server without installing software in my local machine

Srinika Pinnaduwage
  • 1,044
  • 1
  • 7
  • 14
  • 1
    if you're trying to get access of your local SQL Server from Google Colab, this might be difficult as, as Google Colab works on internet and might not able to find your local server. You can write codes in any other Editor that runs your script locally on your system, you can try Jupyter Notebook or any other python editor. – Manish Chaudhary Apr 30 '20 at 08:36

1 Answers1

-1

I think it is the same from this post.

You can try:

!apt install unixodbc-dev
!pip install pyodbc