search
HomeBackend DevelopmentPython TutorialSet up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

When it comes to data science, machine learning, or managing AI projects, having the right tools can make all the difference. Anaconda is a powerful library that simplifies managing packages, dependencies, and environments for Python-based projects. If you're working actively with the development of AI models or a beginner looking forward to entering the data science industry, installing Anaconda sets you up with everything you need to hit the ground running.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

This guide will show you the step-by-step process for installing Anaconda on Ubuntu using the installer script and initializing the "conda" environment to start building with it.

Prerequisites

  • A Virtual Machine (such as the ones provided by NodeShift) with at least:

    • 2 vCPUs
    • 4 GB RAM
    • 20 GB SSD
  • Ubuntu 22.04 VM

Note: The prerequisites for this are highly variable across use cases. For a large-scale deployment, one could use a high-end configuration.

Step-by-step process to install Anaconda on Ubuntu 22.04

For this tutorial, we'll use a CPU-powered Virtual Machine by NodeShift, which provides high-compute Virtual Machines at a very affordable cost on a scale that meets GDPR, SOC2, and ISO27001 requirements. It also offers an intuitive and user-friendly interface, making it easier for beginners to get started with Cloud deployments. However, feel free to use any cloud provider you choose and follow the same steps for the rest of the tutorial.

Step 1: Setting up a NodeShift Account

Visit app.nodeshift.com and create an account by filling in basic details, or continue signing up with your Google/GitHub account.

If you already have an account, login straight to your dashboard.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

Step 2: Create a Compute Node (CPU Virtual Machine)

After accessing your account, you should see a dashboard (see image), now:

1) Navigate to the menu on the left side.

2) Click on the Compute Nodes option.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

3) Click on Start to start creating your very first compute node.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

These Compute nodes are CPU-powered virtual machines by NodeShift. These nodes are highly customizable and let you control different environmental configurations, such as vCPUs, RAM, and storage, according to your needs.

Step 3: Select configuration for VM

1) The first option you see is the Reliability dropdown. This option lets you choose the uptime guarantee level you seek for your VM (e.g., 99.9%).

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

2) Next, select a geographical region from the Region dropdown where you want to launch your VM (e.g., United States).

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

3) Most importantly, select the correct specifications for your VM according to your workload requirements by sliding the bars for each option.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

Step 4: Choose VM Configuration and Image

1) After selecting your required configuration options, you'll see the available VMs in your region and as per (or very close to) your configuration. In our case, we'll choose a '2vCPUs/4GB/80GB SSD' as the closest match to the "Prerequisites".

2) Next, you'll need to choose an image for your Virtual Machine. For the scope of this tutorial, we'll select Ubuntu, as we will install Anaconda on Ubuntu.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

Step 5: Choose the Billing cycle and Authentication Method

1) Two billing cycle options are available: Hourly, ideal for short-term usage, offering pay-as-you-go flexibility, and Monthly for long-term projects with a consistent usage rate and potentially lower cost.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

2) Next, you'll need to select an authentication method. Two methods are available: Password and SSH Key. We recommend using SSH keys, as they are a more secure option. To create one, head over to our official documentation.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

Step 6: Finalize Details and Create Deployment

Finally, you can also add a VPC (Virtual Private Cloud), which provides an isolated section to launch your cloud resources (Virtual machine, storage, etc.) in a secure, private environment. We're keeping this option as the default for now, but feel free to create a VPC according to your needs.

Also, you can deploy multiple nodes at once by clicking in the Quantity option.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

That's it! You are now ready to deploy the node. Finalize the configuration summary; if it looks good, go ahead and click Create to deploy the node.

Step 7: Connect to active Compute Node using SSH

As soon as you create the node, it will be deployed in a few seconds or a minute. Once deployed, you will see a status Running in green, meaning that our Compute node is ready to use!

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

Once your node shows this status, follow the below steps to connect to the running VM via SSH:

1) Open your terminal and run the below SSH command:

(replace root with your username and paste the IP of your VM in place of ip after copying it from the dashboard)

ssh root@ip

2) In some cases, your terminal may take your consent before connecting. Enter ‘yes’.

3) A prompt will request a password. Type the SSH password, and you should be connected.

Output:

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

Step 8: Download the Anaconda installer

First, we need to download the Anaconda installer that will further help us to install Anaconda in the system. Use the following command to download the installer:

1) Update the system package source-list and upgrade the softwares.

apt update && apt upgrade -y

Output:

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

2) Add a non-administrative user

To avoid any accidental changes to the entire system, we'll create a non-root or non-administrative user, and do all the installations with that user account.

For the demonstration purposes, we'll create a user named "demo" and log in as the demo user:

(replace demo with your preferred username)

adduser demo-user
usermod -aG sudo demo-user
su - demo-user

Output:

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

3) Navigate to tmp directory

Next, move to the tmp directory to isolate the installation from your working directory

ssh root@ip

4) Download the installer

Use the below command to download the installation script that will be used to install Anaconda and rename it to anaconda.sh

apt update && apt upgrade -y

Output:

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

Step 9: Verify the installer script

Next, use the below command to get the checksum of the downloaded script.

adduser demo-user
usermod -aG sudo demo-user
su - demo-user

Output:

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

To ensure that the downloaded script is not corrupted, match the checksum you got in the above output with the checksums provided by the official Anaconda website.

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

Just like above, if you're able to find your checksum in the list, then the script file is safe to use and proceed with. If not, repeat the above steps to download the script again.

Step 10: Install Anaconda

After verifying the script, proceed with Anaconda installation.

1) Run the script using the below command to start the installation:

cd /tmp

Output:

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

Note: The above command performs a silent installation (non-interactive), which means the installer assumes that you accept the "default" settings, such as the default location and license agreement; hence, it directly installs the package.

However, if you want to specify the location path, you may use the following command to perform the installation in interactive mode:

wget -O anaconda.sh https://repo.anaconda.com/archive/Anaconda3-2024.06-1-Linux-x86_64.sh

2) Initialize Anaconda

If you installed the package in non-interactive mode or installed in interactive mode but entered NO when asked for auto-initialization, then use the following command to activate Anaconda:

sha256sum anaconda.sh

If downloaded in interactive mode and entered YES in the auto-initialization prompt, then it will get activated automatically after installation. Just refresh the bash file for changes to take effect:

bash anaconda.sh -b

3) Add Anaconda functions

bash anaconda.sh

Output:

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

then refresh the shell:

source <path_to_conda>/bin/activate
</path_to_conda>

4) Verify installation

Finally, let's confirm if the installation is complete and Ananconda is ready to use.

ssh root@ip

Output:

Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow

If you see this, it means the installation and initialization of Anaconda are successful. Now, whenever you open a new terminal, the base environment will initialize automatically, so you can start using conda functions directly. However, if you do not want this behavior and instead prefer activating the environment manually each time before using conda, use the below command to disable this:

apt update && apt upgrade -y

Now, every time you want to use conda, you should first activate the base environment using "conda activate", and then you are good to proceed with using conda.

Conclusion

Installing a powerful Python library like Anaconda is a crucial step for anyone looking to power up their data science or machine learning workflows. This guide walked you through downloading, installing, and activating Anaconda to get your environment ready for efficient development. By deploying our Ubuntu server on NodeShift, we unlocked additional benefits like optimized energy consumption, scalability, and enhanced performance customized to modern workloads. NodeShift's infrastructure ensures a smooth and reliable setup, making it the ideal choice for deploying resource-intensive tools like Anaconda in a sustainable and efficient manner.

For more information about NodeShift:

  • Website
  • Docs
  • LinkedIn
  • X
  • Discord
  • daily.dev

The above is the detailed content of Set up Anaconda on Ubuntu in Minutes: Simplify Your AI Workflow. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
How do you append elements to a Python list?How do you append elements to a Python list?May 04, 2025 am 12:17 AM

ToappendelementstoaPythonlist,usetheappend()methodforsingleelements,extend()formultipleelements,andinsert()forspecificpositions.1)Useappend()foraddingoneelementattheend.2)Useextend()toaddmultipleelementsefficiently.3)Useinsert()toaddanelementataspeci

How do you create a Python list? Give an example.How do you create a Python list? Give an example.May 04, 2025 am 12:16 AM

TocreateaPythonlist,usesquarebrackets[]andseparateitemswithcommas.1)Listsaredynamicandcanholdmixeddatatypes.2)Useappend(),remove(),andslicingformanipulation.3)Listcomprehensionsareefficientforcreatinglists.4)Becautiouswithlistreferences;usecopy()orsl

Discuss real-world use cases where efficient storage and processing of numerical data are critical.Discuss real-world use cases where efficient storage and processing of numerical data are critical.May 04, 2025 am 12:11 AM

In the fields of finance, scientific research, medical care and AI, it is crucial to efficiently store and process numerical data. 1) In finance, using memory mapped files and NumPy libraries can significantly improve data processing speed. 2) In the field of scientific research, HDF5 files are optimized for data storage and retrieval. 3) In medical care, database optimization technologies such as indexing and partitioning improve data query performance. 4) In AI, data sharding and distributed training accelerate model training. System performance and scalability can be significantly improved by choosing the right tools and technologies and weighing trade-offs between storage and processing speeds.

How do you create a Python array? Give an example.How do you create a Python array? Give an example.May 04, 2025 am 12:10 AM

Pythonarraysarecreatedusingthearraymodule,notbuilt-inlikelists.1)Importthearraymodule.2)Specifythetypecode,e.g.,'i'forintegers.3)Initializewithvalues.Arraysofferbettermemoryefficiencyforhomogeneousdatabutlessflexibilitythanlists.

What are some alternatives to using a shebang line to specify the Python interpreter?What are some alternatives to using a shebang line to specify the Python interpreter?May 04, 2025 am 12:07 AM

In addition to the shebang line, there are many ways to specify a Python interpreter: 1. Use python commands directly from the command line; 2. Use batch files or shell scripts; 3. Use build tools such as Make or CMake; 4. Use task runners such as Invoke. Each method has its advantages and disadvantages, and it is important to choose the method that suits the needs of the project.

How does the choice between lists and arrays impact the overall performance of a Python application dealing with large datasets?How does the choice between lists and arrays impact the overall performance of a Python application dealing with large datasets?May 03, 2025 am 12:11 AM

ForhandlinglargedatasetsinPython,useNumPyarraysforbetterperformance.1)NumPyarraysarememory-efficientandfasterfornumericaloperations.2)Avoidunnecessarytypeconversions.3)Leveragevectorizationforreducedtimecomplexity.4)Managememoryusagewithefficientdata

Explain how memory is allocated for lists versus arrays in Python.Explain how memory is allocated for lists versus arrays in Python.May 03, 2025 am 12:10 AM

InPython,listsusedynamicmemoryallocationwithover-allocation,whileNumPyarraysallocatefixedmemory.1)Listsallocatemorememorythanneededinitially,resizingwhennecessary.2)NumPyarraysallocateexactmemoryforelements,offeringpredictableusagebutlessflexibility.

How do you specify the data type of elements in a Python array?How do you specify the data type of elements in a Python array?May 03, 2025 am 12:06 AM

InPython, YouCansSpectHedatatYPeyFeLeMeReModelerErnSpAnT.1) UsenPyNeRnRump.1) UsenPyNeRp.DLOATP.PLOATM64, Formor PrecisconTrolatatypes.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft