Anaconda 3.x安装GraphLab遇到的问题

因为需要,所以在自己的机器上使用GraphLab,但是出现了问题,如下:

  1. 当我在Jupyter中键入:import graphlab,并执行的时候报错:
    ---------------------------------------------------------------------------
    ModuleNotFoundError                       Traceback (most recent call last)
     in ()
    ----> 1 import graphlab
    
    ModuleNotFoundError: No module named 'graphlab'
    
    • 这是因为GraphLab目前支持的版本是2.x,而我的环境是3.x,故而报错找不到,解决方案:
      • 创建一个2.7的虚拟环境,cmd环境下执行:conda create -n python27 python=2.7
      • 激活这个环境activate python27,否则报错:
        Could not find a version that satisfies the requirement graphlab-create>=2.1 (from GraphLab-Create-License==2.1) (from versions: )
        No matching distribution found for graphlab-create>=2.1 (from GraphLab-Create-License==2.1)
        
  2. 在GraphLab官网注册,并通过邮件获取到Product Key执行下列命令安装GraphLab:
    pip install --upgrade --no-cache-dir https://get.graphlab.com/GraphLab-Create////GraphLab-Create-License.tar.gz
    
    • 安装过程如果出现报错:Cannot uninstall 'certifi'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.,问题在于pip的版本问题,更新全局虚拟环境的pip版本:\envs\python27\python.exe -m pip install pip==9.0.1
    • 还有一个红色的报错,不过最后还是安装完成了,不用管:DEPRECATION: Uninstalling a distutils installed project (certifi) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    • 如果网络不好, 可以使用国内的pip源,就是在原有的安装命令最后添加-i --trusted-host ,国内的pip源还是比较多的,整理了几个(右键复制链接),如下:阿里云pip源,中国科技大学pip源,豆瓣pip源,清华大学pip源, 中国科学技术大学pip源等;
  3. 在Anaconda中切换到python27,安装Jupyter notebook,重启生效,运行Jupyter notebook,写入代码import graphlab,然后执行,结果报错:
    ACTION REQUIRED: Dependencies libstdc++-6.dll and libgcc_s_seh-1.dll not found.
    
    1\. Ensure user account has write permission to C:\Programs\Anaconda3\envs\python27\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](https://gcc.gnu.org/onlinedocs/libstdc++/manual/license.html)
    * xz: [http://git.tukaani.org/?p=xz.git;a=blob;f=COPYING](http://git.tukaani.org/?p=xz.git;a=blob;f=COPYING)
    • 在win上开启C:\Programs\Anaconda3\envs\python27\lib\site-packages\graphlab的所有权限;
    • 执行在JupyterNoteBook上执行graphlab.get_dependencies(),如果不成功,多试几次,我的浏览器上装了谷歌访问助手一直装不成功,禁用之后试了1次就成功了;
    • 重启,再次导入import graphlab就成功了
  4. 每次需要使用虚拟环境的时候,需要执行命令:activate python27,即在Anaconda中切换环境即可;
    activate python27

你可能感兴趣的:(Anaconda 3.x安装GraphLab遇到的问题)