Traditional AI Development Environment Setup

Heting Li
5 min readApr 24, 2024

--

Photo by Eberhard Grossgasteiger
  1. Introduction

What do you feel about the online python development environment? Are you thinking about migrate the “Two Click” demo to your private development environment?

The online Jupyter Notebook development may works pretty well for training, knowledge sharing purpose, however it does not fit the sophisicated and extensive AI development process. Especially for the company proprietary AI project, we need a dedicated private AI development Environment!

This chapter give an example of AI development Environment setup for Traditional AI based on Scikit-Learn. This tutorial provide a step-by-step instruction to setup the environment.

2. Development Environment Overview

There are various kind of development environment flavors depends on the characteristics of AI project as well as preferences from organization and developers. In this tutorial, the AI development environment’s setup is illustrated in below diagram, and our setup instruction following bottom-up approach to build it.

Though this setup is built for a demonstration, its structure aligns with many AI development projects. Conda and Jupyter Notebook, in particular, are ubiquitous tools that you’ll encounter and utilize frequently as you explore the AI world.

The virtual development environment offered by venv and Anaconda simplifying package management for different AI projects and AI tasks. This is crucial due to the complex dependencies across all open-source python libraries.

Jupyter Notebooks, a powerful tool that allows users to create and share documents that contain live code, equations, visualizations, and narrative text. It is very useful in AI community to illustrate a AI assignment or project in a one pager method, thanks to the simplified code by using AI related libraries, for example, scikit-learn.

3. Experiment

Let us experiment to get your First AI development Environment, following the steps outlined below:

Time: Approximately 60 min

Hardware Requirement: Any modern PC should work. No dedicate requirement on CPU, Memory. Disk may require 500MB to 1G. And GPU is NOT required.

Instructions:

  • Step 1: Prepare: Install MicroSoft VS Code
  • Step 2: Install Python
  • Step 3: Setup Development Environment:
  • Step 3.1: Install Extension in VSCode
  • Step 3.2: Create Python Development Virtual Environment.(Either venv or conda).
  • Step 3.3: Install required AI and Python libraries
  • Step 4: Run the demo “Recognizing hand-written digits” again on the environment.

3.1 Install MicroSoft VS Code

Open website: Visual Studio Code — Code Editing. Redefined , download the Stable Build for your operation system, and install it.

3.2 Install Python

This step can be skipped, if you will use Anaconda for virtual environment management, since python is integrated in Anaconda.

Open website: Download Python | Python.org, download the Stable Build for your operation system, and install it.

3.3 Install Extension in VSCode

Click the setting bottom on the bottom-left, and search for below popular extensions for AI development: Python, Jupyter,

There will be other extensions installed together with Python and Jupyter. Below is a snapshot of the extension list enabled

3.3 Create Python Development Virtual Environment (venv)

venv is a module available in Python that provides support for creating lightweight "virtual environments" to manage separate package installations for different projects.

  1. Create a Folder for your AI project and open it via VSCode

2. Press Ctrl+Shift+P

3. On the top of the GUI, Search “Python: Create Environment”

3. Two options available: venv and conda.

We use venv in this tutorial as it is much lighter than Anaconda. We will introduce Anaconda when come to Deep Learning Tutorials

4. Select the installed python in Step 2 as interpreter.

It is possible to select other python version as alternative interpreter if it is installed.

5. Wait until the environment finish and check the .venv folder under you project folder

6. Open Windows Command Prompt and go to the .venv/Scripts folder, and run activate.bat

7. Under the venv session, Install the required libraries for the AI demo Recognizing hand-written digits, and Jupyter Notebook.

pip install scikit-learn

pip install matplotlib

pip install ipykernel

8. Download the Jupyter Notebook file from Recognizing hand-written digits by clicking download link at the bottom as shown below, and upload to the project folder.

9. Open the .ipynb file, and click “Run All”. Run the Demo on your private AI development environment!

There are many possible actions on the individual cell. Feel free to explore them. The most useful button are “Execute Above Cells” and “Execute Cell and Below”.

4. Conclusion

Now you should have your own private development environment which offer more flexibility and compatibility to process private or confidential data , and you may proceed AI modeling with other extensive libraries !

Although the development environment may vary and continuously evolve, the fundamental building blocks are common. For example, the Conda Virtual Environment, Python Interpreter, AI Related Libraries , and Jupyter NoteBook are commonly used in many modern AI tasks and projects.

5. What is Next Step

Use Case is All You Need!

Would you like to start to build a AI program on your own from scratch? If you do not have much experience with Python or lack of knowledge about AI library, Do Not Worry! We can let AI help you on the AI programing.

Let us go to next Tutorial Traditional AI — Use Case is All You Need! (Use AI to develop AI)

--

--