GraphLab Installation with Conda (Python 2.7 + 3.9, using multiple versions in Ipython Notebook) for Windows

Claire Zhang
4 min readNov 12, 2020

--

This article provides a tutorial on how to install graphlab with python 2.7 on a pre-installed Anaconda v4.9.1, python 3.x environment. After following through this article, you will be able to install graphlab on Python 2.7 with multiple ipython kernels. Using a virtual environment, you can have separate Python 2 and 3 environments. (It gives you the flexibility to switch between environments and can still use packages that become deprecated)

If you are taking the Machine Learning Foundations: A Case Study Approach course offered by University of Washington, you might have encountered errors with graphlab installation. If so, this article will help you fix the issues.

https://www.coursera.org/specializations/machine-learning

If you come to this page, I assume that you have already registered and received a key from Academic Use of GraphLab Create; we will go through how to install the graphlab package in a later section.

Step 1: Create a New Conda Environment

Before we get started, here are some things to check in Anaconda Prompt before we create a new environment:

  1. Make sure you have anaconda 4.1.0 or higher.
  2. Check your conda list to see if you have nb_conda_kernels (This package detects conda environments with notebook kernels and automatically registers them.)
  3. If you don’t have nb_conda_kernels, install this package with the following command:
conda install nb_conda_kernels

I’m using Python 3 and want a separate Python 2 environment. Start Anaconda Prompt and run the following command to create a conda environment named py27 in python version 2.7 with ipykernal package.

ipykernel package is a powerful interactive Python shell and a Jupyter kernel to work with Python code in Jupyter notebooks and other interactive frontends.

conda create --name py27 python=2.7 ipykernel

I had tons of issues when I first created this python 2 environment. You can skip this paragraph, if you don’t encounter problems. After a lot of trial and error creating a virtual environment, I ended up having duplicate files in my scripts folder. Below is an example of an error message I encountered. Somewhere on stackoverflow, I found a suggestion to clean up the packages by typing “conda clean -tipsy”.

$ C:\Windows\system32\cmd.exe /d /c D:\Program Files\Anaconda\Scripts.ipykernel-post-link.bat
==> cwd: D:\Program Files\Anaconda\Scripts <==
==> exit code: 1 <==
==> stdout <==
==> stderr <==

Close your terminal and open up a new terminal. Type “jupyter notebook”. Click new and you will see your virtual environment listed.

Step 2: Activate conda environment

Go back to Anaconda Prompt using py27 environment.

activate py27

Your directory would change from:

You can also check the environment list by typing “conda env list” in the command prompt.

Make sure you have the latest pip version (version must ≥7).

# Ensure pip is updated to the latest version
# miniconda users may need to install pip first, using 'conda install pip'
conda update pip

Step 3: Install GraphLab Create

# 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

Step 4: Valid the Installation

Type “python” into your command prompt to activate the python terminal. Then type “import graphlab” to verify the installation.

If you get a message regarding install dependencies like the following, simply run “graphlab.get_dependencies()” in python terminal.

ACTION REQUIRED: Dependencies libstdc++-6.dll and libgcc_s_seh-1.dll not found.1. Ensure user account has write permission to C:\Users\Bee\Desktop\Coursera\gl-env\lib\site-packages\graphlab
2. Run graphlab.get_dependencies() to download and install them.
3. Restart Python and import graphlab again.By running the above function, you agree to the following licenses.* libstdc++: https://gcc.gnu.org/onlinedocs/libstdc++/manual/license.html
* xz: http://git.tukaani.org/?p=xz.git;a=blob;f=COPYING

And then import again and it should work.

However, if you run into another error message after you run the graphlab.get_dependencies() like this page is describing regarding the cython folder inside graphlab site-packages folder. I followed the instruction on the last reply and replaced my local file with the shared file from google drive. Here is the link of the stackoverflow page for your reference.

ContentTooShortError                      Traceback (most recent call last)
<ipython-input-4-9e64085fb919> in <module>()
----> 1 graphlab.get_dependencies()

Test it in Jupiter notebook with SFrame.

Please let me know if you have any question! GOOD LUCK with the course.

--

--

Claire Zhang

I’m a dataviz enthusiast with a curiosity for solving puzzles with data and passion for design.