Python学习:查看Python库的版本和路径以及版本更换

Tensorflow库为例(查看版本查看路径)## 标题

  1. 进入当前python环境,进入编译器;
  2. import tensorflow as tf
  3. tf.__version__ #(查看版本)
  4. tf.__path__ #(查看路径)
  5. 使用 --ignore-installed 覆盖安装
    pip install --ignore-installed tensorflow-gpu==1.12.0

python下查看各个库的版本

  1. 运行cmd或者在安装了Anaconda的条件下运行Anaconda Prompt(最好以管理员的身份运行)
  2. 输入 pip list(得到的结果部分如图显示)
    在这里插入图片描述

python库中版本新旧更替使用(以TensorFlow为例)

  1. 运行cmd或者在安装了Anaconda的条件下运行Anaconda Prompt(最好以管理员的身份运行)

  2. 输入pip uninstall tensorflow
    在这里插入图片描述

  3. 比如现在想安装TensorFlow 1.3.0 的版本,则输入 pip install tensorflow==1.3.0
    在这里插入图片描述
    博客记录学习日常~

猜你喜欢

转载自blog.csdn.net/qq_41780295/article/details/88864322