美文网首页
Anaconda 3.x安装GraphLab遇到的问题

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

作者: 帅可儿妞 | 来源:发表于2018-07-29 16:35 被阅读415次

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

  1. 当我在Jupyter中键入:import graphlab,并执行的时候报错:
    ---------------------------------------------------------------------------
    ModuleNotFoundError                       Traceback (most recent call last)
    <ipython-input-3-986a457431da> in <module>()
    ----> 1 import graphlab
    
    ModuleNotFoundError: No module named 'graphlab'
    
    • 这是因为GraphLab目前支持的版本是2.x,而我的环境是3.x,故而报错找不到,解决方案:
      • 创建一个2.7的虚拟环境,cmd环境下执行:conda create -n gl-env python=2.7
      • 激活这个环境activate gl-env,否则报错:
        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-version(当前2.1)>/<your-registered-email>/<your-product-key>/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版本:<Anaconda-Home>\envs\gl-env\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 <pip-source> --trusted-host <pip-source-host>,国内的pip源还是比较多的,整理了几个(右键复制链接),如下:阿里云pip源中国科技大学pip源豆瓣pip源清华大学pip源中国科学技术大学pip源等;
  3. 在Anaconda中切换到gl-env,安装Jupyter notebook,重启生效,运行Jupyter notebook,写入代码import graphlab,然后执行,结果报错:
    <pre style="box-sizing: border-box; overflow: auto; font-family: monospace; font-size: 14px; display: block; padding: 1px 0px; margin: 0px; line-height: inherit; word-break: break-all; word-wrap: break-word; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); border: 0px; border-radius: 0px; white-space: pre-wrap; vertical-align: baseline; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;">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\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](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)</pre>
    
    
    • 在win上开启C:\Programs\Anaconda3\envs\gl-env\lib\site-packages\graphlab的所有权限;
    • 执行在JupyterNoteBook上执行graphlab.get_dependencies(),如果不成功,多试几次,我的浏览器上装了谷歌访问助手一直装不成功,禁用之后试了1次就成功了;
    • 重启,再次导入import graphlab就成功了
  4. 每次需要使用虚拟环境的时候,需要执行命令:activate gl-env,即在Anaconda中切换环境即可;
    activate gl-env

相关文章

网友评论

      本文标题:Anaconda 3.x安装GraphLab遇到的问题

      本文链接:https://www.haomeiwen.com/subject/axvzmftx.html