1、依赖安装
pip install virtualenv virtualenvwrapper
2、配置环境变量
vi ~/.bash_profile
export WORKON_HOME=/pyhton_workspaces
source /usr/local/bin/virtualenvwrapper.sh
source ~/.bash_profile
3、创建虚拟环境
mkvirtualenv tensorflow
4、pip install tensorflow
附:
切换虚拟环境:workon tensorflow
退出虚拟环境:deactivate