解决win10“ssl module in Python is not available”与国内镜像源加速

  今天搞一手tensorflow2.0,结果发现pip下载不了东西,报的错误是“ssl module in Python is not available”。
在这里插入图片描述
  原来是因为电脑没有安装openssl,导致pip的联网下载功能没法用。

解决方案:

  献上官网链接:http://slproweb.com/products/Win32OpenSSL.html
在这里插入图片描述
  官网里面是这个样子的,由于现在电脑基本都是64位的CPU,因此选择前几个带Win64符号的的下载就可以。本人下载的是开头第一个,点击EXE即可。
  下载下来是这个样:
在这里插入图片描述
  接下来就是喜闻乐见的windows程序安装环节了,因为篇幅所限(???)这里不加赘述,一路点next即可。
  安装完毕之后再使用pip install命令就可以了……不过新的问题又来了,pip install默认使用国外服务器下载,卡的毫无人性还掉线,因此需要换国内的镜像源下载。

国内镜像源下载

  原先的下载命令是:

pip install tensorflow-gpu==2.0.0

  升级,使用国内的镜像源比如豆瓣:

pip install tensorflow-gpu==2.0.0 -i https://pypi.douban.com/simple

  看效果:
在这里插入图片描述
  原先几十KB每秒,现在直接上高铁。

安装时遇到的问题

  ERROR: Cannot uninstall ‘wrapt’. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

  办法1:输入 pip install -U --ignore-installed wrapt enum34 simplejson netaddr

  参考:https://www.cnblogs.com/xiaowei2092/p/11025155.html

在这里插入图片描述

  ERROR: tensorboard 1.14.0 has requirement setuptools>=41.0.0, but you’ll have setuptools 39.1.0 which is incompatible.

  原因: setuptools 版本太低

  办法:更新setuptools版本 输入 pip install --upgrade setuptools
在这里插入图片描述

发布了54 篇原创文章 · 获赞 18 · 访问量 9560

猜你喜欢

转载自blog.csdn.net/m0_37872216/article/details/103121248