conda设置好虚拟环境,激活后却无法调用虚拟环境的包,jupyter无法调用

设置虚拟环境

conda create -n tf2 py=3.7
conda activate tf2
pip install tensorflow-gpu==2.0.0-beta0
ipython
import tensorflow as tf
tf.test.is_gpu_available()

这些命令执行过后,并不能检测到gpu

#查看安装的包,发现是base环境的包
pip list

正确做法

conda activate tf2
conda install ipykernel #this step 
python -m ipykernel install --user --name 环境名称 --display-name "在jupyter中显示的环境名称"#and this step
pip install tensorflow-gpu==2.0.0-beta0
ipython
import tensorflow as tf
tf.test.is_gpu_available()

ok了 ,在ipython就能够启动虚拟环境并调用所需的包了,并能够在jupyter显示
参考资料:
Jupyter can’t find env Python kernels #57

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值