Menu iconMenu iconNatural Language Processing with Python
Natural Language Processing with Python

Chapter 2: Setting Up the Environment

2.1 Setting Up an Integrated Development Environment (IDE)

While it's possible to write Python code in any text editor, using an Integrated Development Environment (IDE) can make your life a lot easier. IDEs provide features like code suggestions, debugging tools, and integrations with version control systems that can significantly speed up your development process.

There are several great IDEs available for Python development. In this book, we'll use Visual Studio Code (VS Code), which is a lightweight but powerful source code editor developed by Microsoft. It's available for Windows, macOS, and Linux, and features built-in support for Python, including features like linting, IntelliSense (code completions), debugging, and more.

You can download VS Code from the official website: https://code.visualstudio.com/

After installing VS Code, you'll also need to install the Python extension. You can do this by opening VS Code and going to the Extensions view (View > Extensions), then searching for the Python extension and clicking Install.

With Python, the necessary libraries, and an IDE installed, you're ready to start writing Python code for NLP tasks.

Download Visual Studio Code Step by Step:

As mentioned before, you can download Visual Studio code from the URL "https://code.visualstudio.com/download" by selecting the right platform:

You can click any of the icons mentioned above, depending on the operating system for which you are planning to download the visual studio code editor.

How to install Visual Studio Code on macOS?

Follow the below steps*(shown in gif file and mentioned in bullet points)* to install the VS Code on macOS:

  1. Download Visual Studio Code for macOS.
  2. After clicking on the Mac option on the download site, it will download a zip file, as shown below:
  3. Double-click on the downloaded zip to expand the contents. It will give a file, as shown below:
  4. Drag "Visual Studio Code.app" to the "Applications" folder, so as it available in the "Launchpad."
  5. Double-click on the "Visual Studio Code" to open.
  6. Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options => Keep in Dock.


How to Install Visual Studio Code on Windows?

Firstly, download the Visual Studio Code installer for Windows. Once it is downloaded, run the installer (VSCodeUserSetup-{version}.exe). It will only take a minute.

Secondly, accept the agreement and click on next.

Thirdly, click on "create a desktop icon" so that it can be accessed from the desktop, and click on Next.

After that, click on the install button.

Finally, after installation completes, click on the finish button, and the visual studio code will get open.

By default, VS Code installs under C:\users{username}\AppData\Local\Programs\Microsoft VS Code.

After the successful installation, let's move to the next section to understand the various components of the User Interface of Visual Studio Code Editor.

What are the essential components of the VS Code?

Visual Studio Code is a code editor at its core. Like many other code editors, VS Code adopts a standard user interface and layout of an explorer on the left, showing all of the files and folders you have access to. Additionally, it has an editor on the right, showing the content of the files you have opened. Below are a few of the most critical components of the VSCode editor:

VS Code comes with a straight-forward and intuitive layout that maximizes the space provided for the editor while leaving ample room to browse. Additionally, it allows access to the full context of your folder or project. The UI is divided into five areas, as highlighted in the above image.

  1. Editor - It is the main area to edit your files. You can open as many editors as possible side by side vertically and horizontally.
  2. SideBar - Contains different views like the Explorer to assist you while working on your project.
  3. Status Bar - It contains information about the opened project and the files you edit.
  4. Activity Bar - It is located on the far left-hand side. It lets you switch between views and gives you additional context-specific indicators, like the number of outgoing changes when Git is enabled.
  5. Panels - It displays different panels below the editor region for output or debug information, errors, and warnings, or an integrated terminal. Additionally, the panel can also move to the right for more vertical space.

VS Code opens up in the same state it was last in, every time you start it. It also preserves folders, layouts, and opened files.

2.1 Setting Up an Integrated Development Environment (IDE)

While it's possible to write Python code in any text editor, using an Integrated Development Environment (IDE) can make your life a lot easier. IDEs provide features like code suggestions, debugging tools, and integrations with version control systems that can significantly speed up your development process.

There are several great IDEs available for Python development. In this book, we'll use Visual Studio Code (VS Code), which is a lightweight but powerful source code editor developed by Microsoft. It's available for Windows, macOS, and Linux, and features built-in support for Python, including features like linting, IntelliSense (code completions), debugging, and more.

You can download VS Code from the official website: https://code.visualstudio.com/

After installing VS Code, you'll also need to install the Python extension. You can do this by opening VS Code and going to the Extensions view (View > Extensions), then searching for the Python extension and clicking Install.

With Python, the necessary libraries, and an IDE installed, you're ready to start writing Python code for NLP tasks.

Download Visual Studio Code Step by Step:

As mentioned before, you can download Visual Studio code from the URL "https://code.visualstudio.com/download" by selecting the right platform:

You can click any of the icons mentioned above, depending on the operating system for which you are planning to download the visual studio code editor.

How to install Visual Studio Code on macOS?

Follow the below steps*(shown in gif file and mentioned in bullet points)* to install the VS Code on macOS:

  1. Download Visual Studio Code for macOS.
  2. After clicking on the Mac option on the download site, it will download a zip file, as shown below:
  3. Double-click on the downloaded zip to expand the contents. It will give a file, as shown below:
  4. Drag "Visual Studio Code.app" to the "Applications" folder, so as it available in the "Launchpad."
  5. Double-click on the "Visual Studio Code" to open.
  6. Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options => Keep in Dock.


How to Install Visual Studio Code on Windows?

Firstly, download the Visual Studio Code installer for Windows. Once it is downloaded, run the installer (VSCodeUserSetup-{version}.exe). It will only take a minute.

Secondly, accept the agreement and click on next.

Thirdly, click on "create a desktop icon" so that it can be accessed from the desktop, and click on Next.

After that, click on the install button.

Finally, after installation completes, click on the finish button, and the visual studio code will get open.

By default, VS Code installs under C:\users{username}\AppData\Local\Programs\Microsoft VS Code.

After the successful installation, let's move to the next section to understand the various components of the User Interface of Visual Studio Code Editor.

What are the essential components of the VS Code?

Visual Studio Code is a code editor at its core. Like many other code editors, VS Code adopts a standard user interface and layout of an explorer on the left, showing all of the files and folders you have access to. Additionally, it has an editor on the right, showing the content of the files you have opened. Below are a few of the most critical components of the VSCode editor:

VS Code comes with a straight-forward and intuitive layout that maximizes the space provided for the editor while leaving ample room to browse. Additionally, it allows access to the full context of your folder or project. The UI is divided into five areas, as highlighted in the above image.

  1. Editor - It is the main area to edit your files. You can open as many editors as possible side by side vertically and horizontally.
  2. SideBar - Contains different views like the Explorer to assist you while working on your project.
  3. Status Bar - It contains information about the opened project and the files you edit.
  4. Activity Bar - It is located on the far left-hand side. It lets you switch between views and gives you additional context-specific indicators, like the number of outgoing changes when Git is enabled.
  5. Panels - It displays different panels below the editor region for output or debug information, errors, and warnings, or an integrated terminal. Additionally, the panel can also move to the right for more vertical space.

VS Code opens up in the same state it was last in, every time you start it. It also preserves folders, layouts, and opened files.

2.1 Setting Up an Integrated Development Environment (IDE)

While it's possible to write Python code in any text editor, using an Integrated Development Environment (IDE) can make your life a lot easier. IDEs provide features like code suggestions, debugging tools, and integrations with version control systems that can significantly speed up your development process.

There are several great IDEs available for Python development. In this book, we'll use Visual Studio Code (VS Code), which is a lightweight but powerful source code editor developed by Microsoft. It's available for Windows, macOS, and Linux, and features built-in support for Python, including features like linting, IntelliSense (code completions), debugging, and more.

You can download VS Code from the official website: https://code.visualstudio.com/

After installing VS Code, you'll also need to install the Python extension. You can do this by opening VS Code and going to the Extensions view (View > Extensions), then searching for the Python extension and clicking Install.

With Python, the necessary libraries, and an IDE installed, you're ready to start writing Python code for NLP tasks.

Download Visual Studio Code Step by Step:

As mentioned before, you can download Visual Studio code from the URL "https://code.visualstudio.com/download" by selecting the right platform:

You can click any of the icons mentioned above, depending on the operating system for which you are planning to download the visual studio code editor.

How to install Visual Studio Code on macOS?

Follow the below steps*(shown in gif file and mentioned in bullet points)* to install the VS Code on macOS:

  1. Download Visual Studio Code for macOS.
  2. After clicking on the Mac option on the download site, it will download a zip file, as shown below:
  3. Double-click on the downloaded zip to expand the contents. It will give a file, as shown below:
  4. Drag "Visual Studio Code.app" to the "Applications" folder, so as it available in the "Launchpad."
  5. Double-click on the "Visual Studio Code" to open.
  6. Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options => Keep in Dock.


How to Install Visual Studio Code on Windows?

Firstly, download the Visual Studio Code installer for Windows. Once it is downloaded, run the installer (VSCodeUserSetup-{version}.exe). It will only take a minute.

Secondly, accept the agreement and click on next.

Thirdly, click on "create a desktop icon" so that it can be accessed from the desktop, and click on Next.

After that, click on the install button.

Finally, after installation completes, click on the finish button, and the visual studio code will get open.

By default, VS Code installs under C:\users{username}\AppData\Local\Programs\Microsoft VS Code.

After the successful installation, let's move to the next section to understand the various components of the User Interface of Visual Studio Code Editor.

What are the essential components of the VS Code?

Visual Studio Code is a code editor at its core. Like many other code editors, VS Code adopts a standard user interface and layout of an explorer on the left, showing all of the files and folders you have access to. Additionally, it has an editor on the right, showing the content of the files you have opened. Below are a few of the most critical components of the VSCode editor:

VS Code comes with a straight-forward and intuitive layout that maximizes the space provided for the editor while leaving ample room to browse. Additionally, it allows access to the full context of your folder or project. The UI is divided into five areas, as highlighted in the above image.

  1. Editor - It is the main area to edit your files. You can open as many editors as possible side by side vertically and horizontally.
  2. SideBar - Contains different views like the Explorer to assist you while working on your project.
  3. Status Bar - It contains information about the opened project and the files you edit.
  4. Activity Bar - It is located on the far left-hand side. It lets you switch between views and gives you additional context-specific indicators, like the number of outgoing changes when Git is enabled.
  5. Panels - It displays different panels below the editor region for output or debug information, errors, and warnings, or an integrated terminal. Additionally, the panel can also move to the right for more vertical space.

VS Code opens up in the same state it was last in, every time you start it. It also preserves folders, layouts, and opened files.

2.1 Setting Up an Integrated Development Environment (IDE)

While it's possible to write Python code in any text editor, using an Integrated Development Environment (IDE) can make your life a lot easier. IDEs provide features like code suggestions, debugging tools, and integrations with version control systems that can significantly speed up your development process.

There are several great IDEs available for Python development. In this book, we'll use Visual Studio Code (VS Code), which is a lightweight but powerful source code editor developed by Microsoft. It's available for Windows, macOS, and Linux, and features built-in support for Python, including features like linting, IntelliSense (code completions), debugging, and more.

You can download VS Code from the official website: https://code.visualstudio.com/

After installing VS Code, you'll also need to install the Python extension. You can do this by opening VS Code and going to the Extensions view (View > Extensions), then searching for the Python extension and clicking Install.

With Python, the necessary libraries, and an IDE installed, you're ready to start writing Python code for NLP tasks.

Download Visual Studio Code Step by Step:

As mentioned before, you can download Visual Studio code from the URL "https://code.visualstudio.com/download" by selecting the right platform:

You can click any of the icons mentioned above, depending on the operating system for which you are planning to download the visual studio code editor.

How to install Visual Studio Code on macOS?

Follow the below steps*(shown in gif file and mentioned in bullet points)* to install the VS Code on macOS:

  1. Download Visual Studio Code for macOS.
  2. After clicking on the Mac option on the download site, it will download a zip file, as shown below:
  3. Double-click on the downloaded zip to expand the contents. It will give a file, as shown below:
  4. Drag "Visual Studio Code.app" to the "Applications" folder, so as it available in the "Launchpad."
  5. Double-click on the "Visual Studio Code" to open.
  6. Add VS Code to your Dock by right-clicking on the icon to bring up the context menu and choosing Options => Keep in Dock.


How to Install Visual Studio Code on Windows?

Firstly, download the Visual Studio Code installer for Windows. Once it is downloaded, run the installer (VSCodeUserSetup-{version}.exe). It will only take a minute.

Secondly, accept the agreement and click on next.

Thirdly, click on "create a desktop icon" so that it can be accessed from the desktop, and click on Next.

After that, click on the install button.

Finally, after installation completes, click on the finish button, and the visual studio code will get open.

By default, VS Code installs under C:\users{username}\AppData\Local\Programs\Microsoft VS Code.

After the successful installation, let's move to the next section to understand the various components of the User Interface of Visual Studio Code Editor.

What are the essential components of the VS Code?

Visual Studio Code is a code editor at its core. Like many other code editors, VS Code adopts a standard user interface and layout of an explorer on the left, showing all of the files and folders you have access to. Additionally, it has an editor on the right, showing the content of the files you have opened. Below are a few of the most critical components of the VSCode editor:

VS Code comes with a straight-forward and intuitive layout that maximizes the space provided for the editor while leaving ample room to browse. Additionally, it allows access to the full context of your folder or project. The UI is divided into five areas, as highlighted in the above image.

  1. Editor - It is the main area to edit your files. You can open as many editors as possible side by side vertically and horizontally.
  2. SideBar - Contains different views like the Explorer to assist you while working on your project.
  3. Status Bar - It contains information about the opened project and the files you edit.
  4. Activity Bar - It is located on the far left-hand side. It lets you switch between views and gives you additional context-specific indicators, like the number of outgoing changes when Git is enabled.
  5. Panels - It displays different panels below the editor region for output or debug information, errors, and warnings, or an integrated terminal. Additionally, the panel can also move to the right for more vertical space.

VS Code opens up in the same state it was last in, every time you start it. It also preserves folders, layouts, and opened files.