Ubuntu 16.04 linux anaconda创建的虚拟环境tensorflow-gpu下运行spyder,令spyder运行的包是虚拟环境下的包

知识共享许可协议 版权声明:署名,允许他人基于本文进行创作,且必须基于与原先许可协议相同的许可协议分发本文 (Creative Commons

快捷键打开终端,输入spyder打开spyder工作界面
在这里插入图片描述
然后点击Tools——Preferences——Run——Console选择第二项
——python interpreter——select the Python interpreter for Spyder consoles——选择第二项use the following Python interpreter——然后在文件夹里面选择相对应的虚拟环境的python
我的是将

home/drl/anaconda3/bin/python

改为:

/home/drl/anaconda3/envs/tensorflow-gpu/bin/python

然后点击应用,再点击OK即可。

在这里插入图片描述
在这里插入图片描述然后运行成功的截图如下所示:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/kellyroslyn/article/details/93500819