一、安装环境:windows10-64位
GraphLab Create的官网有安装步骤,但是对于小白的我来说,有几个坑在里边(https://turi.com/download/install-graphlab-create-command-line.html)
二、正确的安装:
Step 1: Download Anaconda2 v4.0.0
Step 2: Install Anaconda
# Run Anaconda2 v4.0.0 installer.
# Double-click the .exe file to install Anaconda and follow the instructions on the screen.
1.关闭杀毒软件:例如360
2.把系统的环境变量PATH里的自己配的path删掉一些,否则anaconda安装不成功。
3.右击Anaconda2-4.0.0-Windows-x86_64.exe,以管理员身份运行。
(详细的看我上一篇博客https://blog.csdn.net/xiaohanwang/article/details/89028262)
Step 3: Create conda environment
# Create a new conda environment with Python 2.7.x
conda create -n gl-env python=2.7 anaconda=4.0.0
下边是我的命令:
C:\Users\Administrator>conda -V
conda 4.6.9
C:\Users\Administrator>pip -V
pip 9.0.1 from F:\Anaconda2\lib\site-packages (python 2.7)
C:\Users\Administrator>python -V
Python 2.7.13 :: Anaconda 4.0.0 (64-bit)
(确保pip 9.0.1 /python 2.7/conda 4.6.9 。pip的版本不能变,用conda update conda升级到conda 4.6.9,否则执行下一行命令会报错)
C:\Users\Administrator>conda create -n gl-env python=2.7 anaconda=4.0.0
# Activate the conda environment
activate gl-env
C:\Users\Administrator>activate gl-env
Step 4: Ensure pip version >= 7
# Ensure pip is updated to the latest version
# miniconda users may need to install pip first, using 'conda install pip'
conda update pip
(gl-env) C:\Users\Administrator>conda update pip
(这一步执行完会报
PackageNotInstalledError: Package is not installed in prefix.
prefix: F:\Anaconda2\envs\gl-env
package name: pip
千万要注意:不能安装pip,安装之后pip版本就变成最新的pip19.0)
Step 5: 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
(先去官网上申请一下key,可以免费使用一年。命令执行之后,会在安装路径下F:\Anaconda2\envs生产gl-env和.conda_envs_dir_test,不过没有生成就 说明你失败了,可以把envs下的东西删除,然后重新执行此命令)
Step 4: Ensure installation of IPython and IPython Notebook
# Install or update IPython and IPython Notebook
conda install ipython-notebook
到此安装还没有结束,最重要的一条是:把之前删掉的环境变量再给加进去。
WHY?因为我的PATH中有C:\MinGW\bin,执行import graphlab需要它。graphlab是用C来编写的,那么,在运行graphlab时,则需要gcc的编译。所以,我安装了gcc。
验证GraphLab Create是否安装成功:
打开Anaconda Navigator,->home->Jupter notebook点击Launch弹出网页,->New->Python2->输入import graphlab按shift+enter键,没有报错就OK。
ImportError: No module named graphlab说明你的graphlab没装好
ACTION REQUIRED: Dependencies libstdc++-6.dll and libgcc_s_seh-1.dll not found.
我的是我的gcc的环境变量忘记加进去了
三、我的报错信息和安装的一些截图


这就是conda install pip的后果
import graphlab
ImportError Traceback (most recent call last)
in ()
----> 1 import graphlab
ImportError: No module named graphlab
说明graphlab没装好,可以看我的Step 5:把envs下的东西删掉,重新执行pip install --upgrade --no-cache-dir https://*****
ACTION REQUIRED: Dependencies libstdc+±6.dll and libgcc_s_seh-1.dll not found.
- Ensure user account has write permission to F:\Anaconda2\lib\site-packages\graphlab
- Run graphlab.get_dependencies() to download and install them.
- 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
1.运行:graphlab.get_dependencies()
2.下载不来就安装gcc,把gcc的路径放到环境变量中
参考的博客:https://blog.csdn.net/llh_1178/article/details/72800837
https://www.cnblogs.com/lilianjiang/p/9608498.html