Open In App

How to Download and Install Scala packages into Anaconda?

Last Updated : 02 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Scala is an object-oriented highly scalable language. Using it with Anaconda gives ease of working in a desirable environment. Similar to installing TensorFlow, we can download Scala into Anaconda and use it with tools like Jupyter Notebook. For using Scala in Anaconda we need the following,

  • Java JDK
  • Anaconda Navigator
  • Apache Spark
  • and, Scala itself

We need to ensure that we have set the JDK path in environment variables. You can see detailed steps here. It is straightforward to set up, install, and utilize tools like Jupyter Notebook with the help of Anaconda Navigator, a graphical user interface (GUI) tool that is part of the Anaconda distribution.

Downloading and Installing Anaconda Navigator

Step 1: Headover to anaconda.com, hover on Products and select Anaconda Distribution.

selecting-anaconda-distribution

 

Step 2: Download the Anaconda Distribution.

downloading-anaconda-distribution

 

After downloading, follow further installation instructions from here.

Downloading and Setting up Apache Spark

Spark is used for analyzing data. We will need Scala initialization. 

Step 1: Go to spark.apache.org/downloads.html and download Spark. Next, unpack the compressed file and head inside the extracted folder. Copy the path of the folder.

copying-path-of-folder

 

Step 2: Now in the Start Menu search for “Edit the system environment variables” > Environment Variables… > Click “New” under User variables > Add Variable name as SPARK_HOME and paste the previously copied path into Variable value field > Click OK.

Adding-path-to-User-variables

 

Step 3: The last step is to add the path to the “bin”. This ensures that the Apache Spark path can be accessed anywhere from the user’s environment. Now in the same window as the previous click “Path” under User variables > Click “New” in the Edit environment variable window > Write %SPARK_HOME%\bin > Click OK until all windows are closed.

Adding-%SPARK_HOME%\bin

 

Downloading Scala into Anaconda and using it in Jupyter Notebook

In the Start Menu search for “Anaconda Powershell Prompt (anaconda3)” and open it. We will need a spylon-kernel package for Scala.

Step 1: Type pip install spylon-kernel.

installing-spylon-kernel

 

Step 2: Now for the Jupyter kernel type,

python -m spylon_kernel install

installing-Jupyter-kernel

 

We are done downloading Scala into Anaconda.

Opening Jupyter Notebook for Scala

Step 1: Type jupyter notebook into Anaconda Powershell Prompt to open up a fresh Jupiter notebook.

opening-jupyter-notebook

 

Step 2: Now select: New > spylon-kernel.

Selecting-new-spylon-kernel

 

Jupyter notebook is here.

Jupyter-notebook

 



Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads