虚拟环境下tensorflow安装+vscode中使用jupyter

虚拟环境下tensorflow安装

虚拟环境的创建、进入、删除

1. conda创建虚拟环境

conda create -n 虚拟环境名称 python=3.6

2. 进入虚拟环境

activate 虚拟环境名称

3. 移除虚拟环境

conda remove -n 虚拟环境名称 --all

常用镜像源

阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
豆瓣 http://pypi.douban.com/simple
中国科学院 http://pypi.mirrors.opencas.cn/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple

报错(常遇到的坑)及解决方案

使用conda创建虚拟环境时总报错:An unexpected error has occurred. Conda has prepared the above report.

解决方法:
删除C:\Users\用户 中的.condarc文件(有可能是清华镜像源出现问题)

报错:The repository located at pypi.mirrors.opencas.cn is not a trusted or secure host and is being ignored. If this repository is available via HTTPS we recommend you use HTTPS instead, otherwise you may silence this warning and allow it anyway with ‘–trusted-host pypi.mirrors.opencas.cn’.

原来:pip install -i http://mirrors.aliyun.com/pypi/simple tensorflow==1.13.1

修改为:pip install -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com tensorflow==1.13.1问题解决

说明:这是阿里源 --trusted-host mirrors.aliyun.com 这是为了获得ssl证书的认证

vscode中使用jupyter

vscode中配置python解释器

1、先在扩展模块中安装python模块

2、使用Ctrl+Shift+P,输入Python:s,选择对应的python解释器路径
在这里插入图片描述

ipynb内核安装

pip install -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com ipykernel

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值