Setting up the Development Environment (Part 1)-Visual Studio Code and Anaconda

Coursesteach
9 min readJan 13, 2024

--

Introduction

Visual Studio Code and Anaconda are powerful tools for Python developers. However, if you are trying to use Anaconda and Visual Studio Code together there is a good chance you have run into some problems.

One primary obstacle is ensuring that Visual Studio Code recognizes and effectively interacts with Anaconda environments. Without proper setup, users may face issues related to package management, interpreter selection, and environment synchronization.

As common as these tools are for programming with Python, it can be difficult to figure out how to get them to work together. In Visual Studio Code you can run Python code with Anaconda by using the Anaconda Prompt, updating the Visual Studio Code workspace settings to be aware of your Anaconda installation, or adding Anaconda to the Windows Path variable.

Your computer is capable of running many different programs and applications. However, when you want to create or write your own, such as, building a machine learning project, it’s important to set your computer up in the right way. Let’s say you wanted to work with a dataset of patient records to try and predict who had heart disease or not. You’ll need a few tools to do this. One for exploring the data, another for making a predictive model, one for making graphs to present your findings to others and one more to run experiments and put all the others together. If you’re thinking, I don’t even know where to start, don’t worry, you’re not alone. Many people have this problem. Luckily, this is where Anaconda, Miniconda and Conda come in. Anaconda, Miniconda and Conda are tools which help you manage your other tools.

They are important due to following reasons:

1. Anaconda: Comprehensive Environment
2. Miniconda: Lightweight and Flexible
3. Conda: Powerful Package Management

We’ll get into the specifics of each shortly. Let’s start with why they’re important [1].

This article will describe how to implement all three of these methods with step-by-step instructions.

Sections

What is Anaconda
Virtual Environment in Anaconda
Installing Anaconda
Installing VS Code
Installing Python
Python Setup in VS code
Setup Interpreter VS Code using Anaconda

Section 1- What is Anaconda?

Anaconda is software distributions. Actually, Anaconda is more than just a software distribution; it’s a comprehensive ecosystem tailored specifically for data science and machine learning endeavors.

Anaconda comes with over 150 data science packages, covering everything from data manipulation and analysis to machine learning algorithms and visualization tools. Everything you could imagine, where as, Miniconda comes with a handful of what’s needed. A package is a piece of code someone else has written which can be run and often serves a specific purpose. You can consider a package as a tool you can use for your own projects[1].

The concept of packages is fundamental to the functionality of both Anaconda and Miniconda. Packages are helpful because without them, you would have to write far more code to get what you need done. These packages encapsulate solutions to common problems encountered in data science and software development, enabling users to leverage existing code rather than reinventing the wheel. Since many people have similar problems, you’ll often find a group of people have written code to help solve their problem and released it as a package [1].

Conda is a package manager. It helps you take care of your different packages by handling installing, updating and removing them. It simplifies the process of managing software dependencies, ensuring that users can seamlessly integrate and utilize the diverse array of packages available in the Anaconda ecosystem anaconda can be thought of the data scientists hardware store providing a comprehensive array of tools essential for various stages of the data science workflow. From tools for exploring datasets, to tools for modelling them, to tools for visualising what you’ve found. Everyone can access the hardware store and all the tools inside [1].With Anaconda, the entire data science ecosystem is readily accessible to everyone, empowering individuals and organizations alike to harness the power of data for informed decision-making and innovation.

Section 3- Virtual environments in Anaconda

What is it: A virtual environment is like a “workspace” where you can install a set of packages with specific versions. These environments are isolated from each other and from the base environment of your system. [3].

So, why use virtual environments at all [3]?

  • Primary reason for using virtual environments lies in managing dependencies and avoiding conflicts between packages.
  • Different packages can have conflicting requirements for their dependencies, meaning installing one may cause the other to stop working.
  • If you put them in separate environments instead, you can switch between the environments as needed, and both will continue to work.
  • This enhances project stability and reproducibility, as you can rest assured that each project’s dependencies are contained and managed separately

Thus by using environments, you won’t breaking existing projects when you install, update, or remove packages, since each project can have its own environment.

You can also delete environments once you’re done with them, and if you run into problems with an environment, it’s easy to start a new one!

In Short, virtual environments serve as invaluable tools for managing dependencies, resolving conflicts, and maintaining project isolation in Python development.

By leveraging virtual environments, you can ensure project stability, streamline package management, and enhance productivity in your coding endeavors.

Section 3. Installing Anaconda

1- Visit the official Anaconda Website:

> Provide your email to download distribution

> It will send a link to your Email.

> Click on Download Now.

> It will redirect you the Anaconda Download Webpage.

> Click on Download to get download started

> It will take some time to download as the Anaconda File Size is pretty large.

> After Downloading, Run the Installer

> Keep all settings to Default.

> Anaconda has been installed Successfully.

Section-4: Installing Visual Studio Code:

> Navigate to the official Visual Studio Code website.

> Download the installer compatible with your operating system.

> Run Installer: Once the download is complete, run the installer and follow the on-screen prompts to install Visual Studio Code.

> When installing Visual Studio Code (VSC), you can keep all the default settings.

>Click on VS Code Icon on Desktop.

Section-5: Python Setup in VS Code:

Setting up the Python extension in Visual Studio Code (VS Code) is a straightforward process. Here’s a step-by-step guide to help you get started:

>Open Visual Studio Code

> Click on the Extensions view icon on the Sidebar (or press Ctrl+Shift+X), then search for "Python" in the Extensions Marketplace.

>The official Python extension should appear at the top of the search results. Click the “Install” button next to it to install the extension.

Open Vscode> Extension>Python(intellisense)

Section-7: Setup Interpreter VS Code using Anaconda

> Open VS Code

> Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS) to open the Command Palette.

> open user setting

> Search Python Path

Alternative Method:

Ø If the selected Anaconda environment is not automatically activated, you might need to activate it manually. You can do this by opening a terminal in VS Code (`Ctrl+``) and running:

With the Anaconda interpreter set up in Visual Studio Code, you’re ready to start coding in Python! Write your Python code in the editor, and use the various features provided by the Python extension for code editing, debugging, and more.

That’s it! You’ve successfully set up the Python interpreter in Visual Studio Code using Anaconda. Now you can seamlessly develop Python projects within the Anaconda environment using the powerful features of VS Code

Section-8: Installing Python

>Navigate to the Python official Website.

Ø Choose your Python Version and Opening System and click on Download Link to Start downloading the Python Installer File.

Ø Once download is complete, run the python installer.

Ø Proceed with the installation by clicking “Install” or “Next.” The installer will then copy the necessary files and configure Python on your system. This process may take a few minutes to complete.

Ø Congratulations! You’ve successfully installed Python on your system. You can now start using Python for coding, scripting, or running Python programs.

Please Follow and 👏 Clap for the story courses teach to see latest updates on this story

🚀 Elevate Your Data Skills with Coursesteach! 🚀

Ready to dive into Python, Machine Learning, Data Science, Statistics, Linear Algebra, Computer Vision, and Research? Coursesteach has you covered!

🔍 Python, 🤖 ML, 📊 Stats, ➕ Linear Algebra, 👁️‍🗨️ Computer Vision, 🔬 Research — all in one place!

Don’t Miss Out on This Exclusive Opportunity to Enhance Your Skill Set! Enroll Today 🌟 at

Visual Studio Code

🔍 Explore cutting-edge tools and Python libraries, access insightful slides and source code, and tap into a wealth of free online courses from top universities and organizations. Connect with like-minded individuals on Reddit, Facebook, and beyond, and stay updated with our YouTube channel and GitHub repository. Don’t wait — enroll now and unleash your Deep Learning potential!”

Stay tuned for our upcoming articles because we research end to end , where we will explore specific topics related to Machine Learning in more detail!

Remember, learning is a continuous process. So keep learning and keep creating and Sharing with others!💻✌️

Note:if you are a Machine Learning export and have some good suggestions to improve this blog to share, you write comments and contribute.

if you need more update about Machine Learning and want to contribute

👉📚GitHub Repository

👉 📝Notebook

Do you want to get into data science and AI and need help figuring out how? I can offer you research supervision and long-term career mentoring.
Skype: themushtaq48, email:mushtaqmsit@gmail.com

Contribution: We would love your help in making coursesteach community even better! If you want to contribute in some courses , or if you have any suggestions for improvement in any coursesteach content, feel free to contact and follow.

Contribution

We extend our sincere appreciation to Saad Abbasi(Github), a respected Student at the Virtual University of Pakistan, for their valuable contributions to this article. Mr Saad Abbasi’s expertise and dedication have greatly enriched our content and enhanced the learning experience for our audience. We are grateful for Saad Abbasi’s commitment to advancing education within the Coursesteach Community.

Together, let’s make this the best AI learning Community! 🚀

👉WhatsApp

👉 Facebook

👉Github

👉LinkedIn

👉Youtube

👉Twitter

Source

1-Python — Setup Visual Studio Code with Anaconda

2-Getting your computer ready for machine learning: How, what and why you should use Anaconda, Miniconda and Conda

3-Get started with conda environments(Unread)

4-Installing Python (Unread)

--

--