דלג לתוכן העיקרי

Guide: Using Microsoft Data Tools on MacBook M1

10/15/2024
4 min read
Setting up Microsoft data tools on MacBook M1

Introduction

As MacBook M1 users, we frequently encounter challenges when trying to work with Microsoft's data tools. During my data analytics course, I ran into many issues working with SQL Server, Power BI, and Excel. In this article, I'll share the solutions I found and how to overcome these challenges.

Note: I'm aware that there are various solutions to these issues, but I'll focus on the easiest, most accessible, and most stable methods (which may include paid tools). If you're looking for professional advice on data analytics, we at Whale Group would be happy to help.

If you have suggestions for improving and streamlining these processes, I'd love to hear them. I'm open to collaboration and recommendations as I'm a data analyst at the beginning of my journey.

Installing Parallels Desktop

To get started, we need to install Parallels Desktop on your MacBook M1. This software allows you to run Windows on a virtual machine.

  1. Download and install Parallels Desktop.
  2. Follow the installation instructions and set up a new virtual machine (VM) with Windows.

After installation, you should have a Windows environment running on your Mac.

Installing Docker and Running MS SQL Server

Docker allows us to run containers, which are lightweight virtual machines that can run applications.

  1. Install Docker on your MacBook M1:

    • Download Docker from the official website.
    • Follow the installation instructions.
  2. Download and run MS SQL Server in a Docker container:

    • Pull the MS SQL Server image from Docker Hub:
      docker pull mcr.microsoft.com/mssql/server
    • Run the container with your desired settings:
      docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=YourPassword123' -p 1433:1433 --name sqlserver -d mcr.microsoft.com/mssql/server
    • Replace YourPassword123 with a strong password of your choice.
  3. Connecting to MS SQL Server from the Windows virtual machine:

    • Use SQL Server Management Studio (SSMS) or another SQL client. Install MS SQL Server
    • Connect using your Mac's IP address and port 1433.
    • Connect with the username sa and the password you set (e.g., YourPassword123).
  4. Running Docker commands from the Mac terminal:

    • To start the container if it stopped:
      docker start sqlserver
    • To stop the container:
      docker stop sqlserver
    • To see running containers:
      docker ps

Want to consult with us?

We can help you choose, build and deploy the perfect AI solution for your business. Leave your details and we'll get back to you.

Running Microsoft Power BI and Excel

To work with Power BI and Excel, we need to install them on the Windows virtual machine.

  1. Download and install Microsoft Power BI.
  2. Download and install Microsoft Excel.

After installation, you can use these tools seamlessly in your Windows environment.

Working with Python and Visual Studio Code

To work with Python and connect to MS SQL Server, we need to set up Visual Studio Code (VS Code) in the virtual machine.

  1. Download and install Visual Studio Code.

  2. Install the Python extension for VS Code.

  3. Connecting to MS SQL Server using pandas:

    import pandas as pd
    import pyodbc
     
    conn = pyodbc.connect(
        'DRIVER={ODBC Driver 17 for SQL Server};'
        'SERVER=your_server_name;'
        'DATABASE=your_database_name;'
        'UID=sa;'
        'PWD=YourPassword123'
    )
    query = "SELECT * FROM your_table"
    df = pd.read_sql(query, conn)
    print(df.head())
  4. Resolve any connection issues by verifying that the driver and network settings are correct.

Summary and Tips

In this guide, we covered how to set up a MacBook M1 for working with Microsoft's data tools. We installed Parallels Desktop, Docker, and various Microsoft applications, and demonstrated how to connect Python to MS SQL Server.

Tips:

  • Always keep your software updated to prevent compatibility issues.
  • Use official documentation for troubleshooting and advanced settings.
  • Join online communities and forums for additional support and advice.

By following these steps, you can work efficiently with Microsoft's tools on MacBook M1. Need more help? Contact us.

Michael Romm

Michael Romm

Michael is a co-founder of Whale Group, leading business and marketing strategy. An expert in data (SQL, Python) and developing automation and AI solutions for businesses.

Enjoyed the article? Share it!