ubuntu16.04安装YouCompleteMe+Anaconda+TensorFlow

一、安装ubuntu16.04,下载镜像,一步一步来就行

二、安装vmware tools ,点击安装VMware Tools 然后复制到home,右键提取到此处,右键解压后的文件夹在终端打开,再输入        ~/vmware-tools-distrib$ sudo ./vmware-install.pl 一直enter就行了

三、安装YouCompleteMe插件

  1. 卸载已经存在的vim(若有):sudo apt-get remove vim vim-runtime gvim
  2. 安装vm7.4以上
    1. sudo apt-get install vim-gtk
    2. vim –version | grep python 查看vim对python的支持,默认的应该是支持python3如果要支持python2:                   sudo apt-get install vim-nox-py2
  3. 切换:sudo update-alternatives –config vim  输入编号即可
  4. sudo apt-get install build-essential cmake python-dev python3-dev
  5. 安装vim的扩展管理器Vundle:git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim

下载过程中可能会报错,出现无法下载的错误:

       error: RPC failed; curl 18 transfer closed with outstanding read data remaining

       fatal: The remote end hung up unexpectedly

       fatal: early EOF

       fatal: index-pack failed

解决方法:git config --global http.postBuffer 524288000  原因自己网上查

再重新执行git命令即可

安装完之后配置 .vimrc文件(不要忘记 . ):vim .vimrc 打开 .vimrc文件输入以下内容:

set nocompatible

filetype off

set rtp+=~/.vim/bundle/Vundle.vim

call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

call vundle#end()

filetype plugin indent on

ESC键 然后输入 :PluginInstall 进行Vundle插件的安装

 

安装YouCompleteMe

在上述文件中再添加一行:Plugin 'Valloric/YouCompleteMe'

文件如下:

set nocompatible

filetype off

set rtp+=~/.vim/bundle/Vundle.vim

call vundle#begin()

Plugin 'VundleVim/Vundle.vim'

Plugin 'Valloric/YouCompleteMe'

call vundle#end()

filetype plugin indent on

ESC键,输入 :PluginInstall 进行YouCompleteMe进行安装

切记,安装时间很长,要等等等等等

过了一段时间之后,你要是不想等了,就关闭终端。

然后切换到如下目录:

virtual-machine:~/.vim/bundle/YouCompleteMe$

输入:git submodule update --init –recursive

这个命令可能会执行多次,直到YouCompleteMe下载完成之后

中间可能出现的错误:

fatal: Needed a single revision

Unable to find current revision in submodule path 'third_party/requests'Failed to recurse into submodule path 'third_party/ycmd'

解决方法:~/.vim/bundle/YouCompleteMe$ rm -fr third_party/

然后重新git submodule update --init –recursive即可

重新进入 .vimrc文件,ESC 输入 :PluginInstall

  1. 安装clangsudo apt-get install clang
  2. 还是在YouCompleteMe目录下,输入:./install.py --clang-complet --system-libclang

大功告成

 

四、安装Anaconda3

  1. 下载网址:https://www.anaconda.com/download/#linux
  2. 下载完成后出现Anaconda3-5.3.0-Linux-x86_64.sh 脚本文件
  3. 切换到该文件目录下,输入:bash Anaconda3-5.3.0-Linux-x86_64.sh 进行安装,会有提示,一路ENTER就行了
  4. 完成后配置系统变量(前提你是一路ENTER,如果自己改变了安装了的目录,自行修改下面的”~/anaconda3/”):
    1. echo 'export PATH="~/anaconda3/bin:$PATH"' >> ~/.bashrc
    2. source ~/.bashrc  更新bashrc,立即生效

e) 完成,检查是否安装好:

       cd,输入python,可以看到python是Anaconda版本即可:

五、安装TensorFlow(CPU)

  1. conda create -n tensorflow python=3.6  一定要写全不然可能会出现各种错误
  2. 下载安装包(需要翻墙):https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp36-cp36m-linux_x86_64.whl
  3. 将whl文件重新命名为:tensorflow-1.0.0-py3-none-linux_x86_64.whl 否则会出错
  4. 进入环境安装并安装TensorFlow:

             a):source activate tensorflow  #激活TensorFlow环境

             b):cd /youdownload  #你的电脑whl文件所在目录

             c):pip install --ignore-installed –upgrade tensorflow-1.0.0-py3-none-linux_x86_64.whl

    如果想退出TensorFlow环境:source deactivate即可

    后续使用jupyter notebook出现无法引用包的问题的话

    解决办法:

  1. source activate tensorflow
  2. (tensorflow) lll@lll-virtual-machine:~$ conda install numpy  

通过这种方式,在TensorFlow环境下下载包就行

接着就在相应目录下打开jupyter notebook就行了(TensorFlow环境下,如果你要用TensorFlow的话)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值