一、安装ubuntu16.04,下载镜像,一步一步来就行
二、安装vmware tools ,点击安装VMware Tools 然后复制到home,右键提取到此处,右键解压后的文件夹在终端打开,再输入 ~/vmware-tools-distrib$ sudo ./vmware-install.pl 一直enter就行了
三、安装YouCompleteMe插件
- 卸载已经存在的vim(若有):sudo apt-get remove vim vim-runtime gvim
- 安装vm7.4以上
- sudo apt-get install vim-gtk
- vim –version | grep python 查看vim对python的支持,默认的应该是支持python3如果要支持python2: sudo apt-get install vim-nox-py2
- 切换:sudo update-alternatives –config vim 输入编号即可
- sudo apt-get install build-essential cmake python-dev python3-dev
- 安装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
- 安装clang:sudo apt-get install clang
- 还是在YouCompleteMe目录下,输入:./install.py --clang-complet --system-libclang
大功告成…
四、安装Anaconda3
- 下载网址:https://www.anaconda.com/download/#linux
- 下载完成后出现Anaconda3-5.3.0-Linux-x86_64.sh 脚本文件
- 切换到该文件目录下,输入:bash Anaconda3-5.3.0-Linux-x86_64.sh 进行安装,会有提示,一路ENTER就行了
- 完成后配置系统变量(前提你是一路ENTER,如果自己改变了安装了的目录,自行修改下面的”~/anaconda3/”):
- echo 'export PATH="~/anaconda3/bin:$PATH"' >> ~/.bashrc
- source ~/.bashrc 更新bashrc,立即生效
e) 完成,检查是否安装好:
cd,输入python,可以看到python是Anaconda版本即可:
五、安装TensorFlow(CPU)
- conda create -n tensorflow python=3.6 一定要写全不然可能会出现各种错误
- 下载安装包(需要翻墙):https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.0.0-cp36-cp36m-linux_x86_64.whl
- 将whl文件重新命名为:tensorflow-1.0.0-py3-none-linux_x86_64.whl 否则会出错
- 进入环境安装并安装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出现无法引用包的问题的话
解决办法:
- source activate tensorflow
- (tensorflow) lll@lll-virtual-machine:~$ conda install numpy
通过这种方式,在TensorFlow环境下下载包就行
接着就在相应目录下打开jupyter notebook就行了(TensorFlow环境下,如果你要用TensorFlow的话)