Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Getting started with GraphLab and installing Python, iPython Notebooks

I am following R programming language for some time. But sometimes, I wonder how Python would have worked in those scenarios.  After all, Python has more followers. So, one fine morning I decided to set my hands on Python. 

I opted for a Coursera Course on "Machine Learning Foundations: A Case Study Approach" which I liked because it started at the very basic of Python and followed a case study approach. 


I downloaded Python 3.7.2  for Mac OS X, which is the latest version.  But, this particular course is using Graphlab Create and I needed a different version of Python. GraphLab Create is a highly scalable machine learning library for Python, which also includes the SFrame, a highly-scalable library for data manipulation. So, my this post is more about running Ipython Notebook and GraphLab Create locally on my own computer.


Below are the steps to install and run the GraphlLab Create:


1. GraphLab Create is not free software. But they provide a 1-year, renewable license for educational purposes.  So first, Register for GraphLab Create at turi and a product key will be emailed to the registered address. 


2. Since I have Mac(10.12.6 ), I downloaded "Graphlab Create Launcher" for Mac OS X 
here.

3. Once downloaded, I added the GraphLab Launcher to the Applications Folder and started the installations.


4. Provided the product key and followed the installation instructions. So, the Launcher will do the following:

5. But sadly for me, the launcher ended in an error.
The Log says below:
===============================================================
WARNING: could not import _license.show_info
# try:
# $ conda install -n root _license
===================
There was a problem creating the "gl-env" conda environment.  Restart GraphLab Create Launcher.
Process completed with exit code -1
===============================================================
On checking the log more closely, it showed the python version 2.7.13 is installed. Anaconda installation did not clash with the existing Python installation. I have both the vesrions now.

I navigated to the path where I had installed the "Anaconda" package and there is an "envs" folder which is empty.


I launched the navigator and on the "Environments" tab, I saw one "create" option. 
Provided the Environment name as "gl-env" and did OK. "gl-env" is created after some time.
That being done, still, I was not sure if I have everything ready to use GraphLab. So, I decided to start with the course and see how far I can proceed.

Next step is to launch iPython notebook from Home. So, click on Launch at Jupyter notebook.

To create a new iPython Notebook, navigate to New -> Python2
Thus, a new blank iPython Notebook is launched and type "import graphlab". 
Immediately it resulted in an error saying " No module named graphlab".


Hmmm, so GraphLab Module is not installed. What next? I followed the steps mentioned here.

1. Open a Terminal from gl-env environment.

2. Run the below commands as mentioned in the above link:

Since Anaconda is already installed, I skipped the first 2 steps. But while trying to create a new Conda environment, I was getting an error: 

bash: conda: command not found

To get rid of that error I used the below command first to set the path:

1. export PATH=~/anaconda/bin:$PATH

2.  #Create a new conda environment with Python 2.7.x
# Since I already created the environment manually, this step is also not required and on running the below command it will say that it already exist.
conda create -n gl-env python=2.7 anaconda=4.0.0

3. # Activate the conda environment
source activate gl-env

4. # install pip
conda install pip

5. # Install your licensed copy of GraphLab Create
pip install --upgrade --no-cache-dir https://get.graphlab.com/GraphLab-Create/2.1/your registered email address here/your product key here/GraphLab-Create-License.tar.gz

Now, GraphLab is installed. Let's go back to my iPython Notebook and check if I can import graphlab. But first, make sure to terminate all the terminals and close the Navigator and reopen it.

"import graphlab" was still giving me the same error. I checked graphlab is installed. What can be the issue?  Let's check the paths:
import sys
sys.path
sys.path.append('/Users/oindrilasen/anaconda/envs/gl-env/lib/python2.7/site-packages')

And Voila, it worked! The issue was the path. So I need to append the path where I have installed GraphLab each time I am importing the GraphLab package. Got It!


This post first appeared on What The Data Says, please read the originial post: here

Share the post

Getting started with GraphLab and installing Python, iPython Notebooks

×

Subscribe to What The Data Says

Get updates delivered right to your inbox!

Thank you for your subscription

×