tensorflow项目运行

运行一个tensorflow项目

1. 安装tensorflow

  • 安装最新版本2.1.0:pip install tensorflow
  • error:Cannot uninstall 'wrapt'. It is a distutils installed project 方法:pip install -U --ignore-installed wrapt enum34 simplejson netaddr
  • error:Cannot uninstall 'six'. It is a distutils installed project... 方法:pip install six --upgrade --ignore-installed six
  • error:Cannot uninstall 'html5lib'. It is a distutils installed project and thus we cannot accurately.... 方法:参考
  • 测试安装: import tensorflow
  • error: ImportError: Could not find 'msvcp140.dll'. TensorFlow requires that this DLL be installed in a
  • 方法: 安装Visual C ++ 下载链接
  • error: ModuleNotFoundError: No module named 'tensorflow.contrib 方法:准备安装1.x版本

2. 安装1.8.0版本tensorflow

  • 安装: pip install tensorflow==1.8.0
  • error: from numpy.lib.arraypad import _validate_lengths ImportError: cannot import name '_validate_lengths' 方法:降低numpy版本
    • 安装numpy:pip install numpy==1.8.2
    • error:Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: 'E:\anaconda3\Lib\site-packages\numpy\.libs\libopenblas.PYQHXLVVQ7VESDPUVUADXEVJOBGHJPAY.gfortran-win_amd64.dll'Consider using the --user option or check the permissions.
    • 成功安装跟新numpy(具体问题看其他部分)
  • 运行程序
    • error:NotImplementedError: you are using tensorflow version 1.8.0 but only versions 1.3.0 to 1.3.1 are supported
    • 安装1.3.0版本: pip install tensorflow==1.3.0

3.安装虚拟环境

  • 配置方法
  • error: ERROR: Could not install packages due to an EnvironmentError: [WinError 5] 拒绝访问。: 'E:\virtualenv\polyrnn-pp-master\Lib\site-packages\numpy\.libs\libopenblas.BNVRK7633HSX7YVO2TADGR4A5KEKXJAW.gfortran-win_amd64.dll'

4. 运行juputer文件

其他问题

  1. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
  • 使用命令:python -m pip install --user --upgrade pip==20.0.2
  • Requirement already up-to-date: pip==20.0.2 in e:\anaconda3\lib\site-packages (20.0.2): 提示已经存在
  • 删除文件夹
  • 再次尝试:成功
  1. numpy包异常,却可以正常导入numpy

  • 删除Lib文件夹下相应的numpy包,再次尝试,成功
  • 类似方法跟新requests包

pip 常用命令

  • 安装特定版本: pip install numpy==1.13.1
  • 查看版本信息: pip show numpy
  • 卸载版本: pip uninstall numpy
posted @ 2020-03-10 18:05  -Rocky-  阅读(820)  评论(0编辑  收藏  举报