Anaconda3-4.2.0安装tensorflow过程记录

  1. 打开anaconda prompt

  2. 进入D盘的sdxx目录,添加condarc配置文件的内容

D:
cd sdxx
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes
  1. 用记事本打开C盘的 用户/82444/.condarc

    删除如下代码:- defaults

  2. 继续在prompt中,

conda install tensorflow
   此时报错:

Fetching package metadata ...SSL verification error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
 
.SSL verification error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:645)
 
.
 
Solving package specifications: .
 
PackageNotFoundError: Package not found: '' Packages/dependencies missing in current win-64 channels:
 
  - tensorflow
 
  - conda -> conda-env >=2.6
 
  - conda-env
 
Close matches found; did you mean one of these?
 
    conda-env: conda
 
    conda-env: conda
 
 
You can search for packages on anaconda.org with
 
    anaconda search -t conda tensorflow
 
(and similarly for the other packages)
  1. 把.condarc中的https改为http

  2. prompt中,

conda search tensorflow
 
anaconda show anaconda/tensorflow
 
conda install --channel https://conda.anaconda.org/anaconda tensorflow
  1. 打开jupyter notebook,new一个conda root的python文件,输入代码测试是否安装成功:
import tensorflow as tf
tf.__version__

报错,说numpy不存在。此时用管理员身份打开anaconda prompt,

conda uninstall numpy --force  //只卸载numpy,若不加--force参数,会同时把tensorflow也卸载
 
conda install numpy   //安装numpy
  1. notebook重新运行代码,出现了版本号,表示成功

【参考】
1)https://blog.csdn.net/yzj001616/article/details/128410463
2)https://blog.csdn.net/cecurio/article/details/106732428?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-3-106732428-blog-132580261.235^v39^pc_relevant_default_base&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-3-106732428-blog-132580261.235^v39^pc_relevant_default_base&utm_relevant_index=6https://blog.csdn.net/cecurio/article/details/106732428?spm=1001.2101.3001.6650.3&utm_medium=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-3-106732428-blog-132580261.235^v39^pc_relevant_default_base&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2~default~CTRLIST~Rate-3-106732428-blog-132580261.235^v39^pc_relevant_default_base&utm_relevant_index=6

posted @ 2023-12-13 19:12  Morri3  阅读(27)  评论(0编辑  收藏  举报