完美解决安装完tensorflow后pip无法使用的问题

 更新时间:2018年06月11日 10:26:41   作者:Adonay  
今天小编就为大家分享一篇完美解决安装完tensorflow后pip无法使用的问题,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

Win8,ANACONDA3(64-bit),Python3.6.2。ANACONDA Prompt中不能用pip命令安装包,并且是在安装了TensorFlow后才发生的。

报错如下:

F:\360Downloads>pip install --upgrade pip
Exception:
Traceback (most recent call last):
 File "E:\tools\anaconda\py3\lib\site-packages\pip\basecommand.py", line 215, in main
 status = self.run(options, args)
 File "E:\tools\anaconda\py3\lib\site-packages\pip\commands\install.py", line 335, in run
 wb.build(autobuilding=True)
 File "E:\tools\anaconda\py3\lib\site-packages\pip\wheel.py", line 749, in build
 self.requirement_set.prepare_files(self.finder)
 File "E:\tools\anaconda\py3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
 ignore_dependencies=self.ignore_dependencies))
 File "E:\tools\anaconda\py3\lib\site-packages\pip\req\req_set.py", line 487, in _prepare_file
 req_to_install, finder)
 File "E:\tools\anaconda\py3\lib\site-packages\pip\req\req_set.py", line 428, in _check_skip_instal
led
 req_to_install, upgrade_allowed)
 File "E:\tools\anaconda\py3\lib\site-packages\pip\index.py", line 465, in find_requirement
 all_candidates = self.find_all_candidates(req.name)
 File "E:\tools\anaconda\py3\lib\site-packages\pip\index.py", line 423, in find_all_candidates
 for page in self._get_pages(url_locations, project_name):
 File "E:\tools\anaconda\py3\lib\site-packages\pip\index.py", line 568, in _get_pages
 page = self._get_page(location)
 File "E:\tools\anaconda\py3\lib\site-packages\pip\index.py", line 683, in _get_page
 return HTMLPage.get_page(link, session=self.session)
 File "E:\tools\anaconda\py3\lib\site-packages\pip\index.py", line 811, in get_page
 inst = cls(resp.content, resp.url, resp.headers)
 File "E:\tools\anaconda\py3\lib\site-packages\pip\index.py", line 731, in __init__
 namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument 'transport_encoding'

解决方案:

1.conda install -c anaconda html5lib

如下场景

F:\360Downloads>conda install -c anaconda html5lib
Fetching package metadata ...............
Solving package specifications: .

Package plan for installation in environment E:\tools\anaconda\py3:

The following packages will be UPDATED:

 anaconda: 5.0.0-py36hea9b2fc_0  --> custom-py36h363777c_0 anaconda
 bzip2:  1.0.6-vc14hdec8e7a_1  --> 1.0.6-vc14_3   anaconda [vc14]
 conda:  4.3.27-py36hcbae3bd_0  --> 4.4.8-py36_0   anaconda
 html5lib: 0.999999999-py36ha09b1f3_0 --> 1.0.1-py36h047fa9f_0 anaconda
 libpng: 1.6.32-vc14hce43e6c_2  --> 1.6.32-vc14h5163883_3 anaconda [vc14]
 openssl: 1.0.2l-vc14hcac20b0_2  --> 1.0.2l-vc14hf4c37d5_5 anaconda [vc14]
 pycosat: 0.6.2-py36hf17546d_1  --> 0.6.3-py36h413d8a4_0 anaconda

The following packages will be SUPERSEDED by a higher-priority channel:

 conda-env: 2.6.0-h36134e3_1   --> 2.6.0-h36134e3_1  anaconda
 curl:  7.55.1-vc14hdaba4a4_3  --> 7.55.1-vc14hdaba4a4_3 anaconda [vc14]
 freetype: 2.8-vc14h17c9bdf_0   --> 2.8-vc14h17c9bdf_0 anaconda [vc14]
 hdf5:  1.10.1-vc14hb361328_0  --> 1.10.1-vc14hb361328_0 anaconda [vc14]
 icu:  58.2-vc14hc45fdbb_0  --> 58.2-vc14hc45fdbb_0 anaconda [vc14]
 jpeg:  9b-vc14h4d7706e_1   --> 9b-vc14h4d7706e_1  anaconda [vc14]
 libiconv: 1.15-vc14h29686d3_5  --> 1.15-vc14h29686d3_5 anaconda [vc14]
 libssh2: 1.8.0-vc14hcf584a9_2  --> 1.8.0-vc14hcf584a9_2 anaconda [vc14]
 libtiff: 4.0.8-vc14h04e2a1e_10  --> 4.0.8-vc14h04e2a1e_10 anaconda [vc14]
 libxml2: 2.9.4-vc14h8fd0f11_5  --> 2.9.4-vc14h8fd0f11_5 anaconda [vc14]
 libxslt: 1.1.29-vc14hf85b8d4_5  --> 1.1.29-vc14hf85b8d4_5 anaconda [vc14]
 qt:  5.6.2-vc14h6f8c307_12  --> 5.6.2-vc14h6f8c307_12 anaconda [vc14]
 sqlite: 3.20.1-vc14h7ce8c62_1  --> 3.20.1-vc14h7ce8c62_1 anaconda [vc14]
 tk:  8.6.7-vc14hb68737d_1  --> 8.6.7-vc14hb68737d_1 anaconda [vc14]
 yaml:  0.1.7-vc14hb31d195_1  --> 0.1.7-vc14hb31d195_1 anaconda [vc14]
 zlib:  1.2.11-vc14h1cdd9ab_1  --> 1.2.11-vc14h1cdd9ab_1 anaconda [vc14]

Proceed ([y]/n)? y

conda-env-2.6. 100% |###############################| Time: 0:00:00 538.73 kB/s
bzip2-1.0.6-vc 100% |###############################| Time: 0:00:02 55.75 kB/s
icu-58.2-vc14h 7% |##        | Time: 0:00:07 233.63 kB/s

2.更新:conda install pip

以上这篇完美解决安装完tensorflow后pip无法使用的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。

相关文章

  • Python restful框架接口开发实现

    Python restful框架接口开发实现

    这篇文章主要介绍了Python restful框架接口开发实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
    2020-04-04
  • Python实现为图片批量添加随机水印

    Python实现为图片批量添加随机水印

    这篇文章主要为大家详细介绍了如何使用Python实现为图片批量添加随机水印,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下
    2023-11-11
  • Python实现Pig Latin小游戏实例代码

    Python实现Pig Latin小游戏实例代码

    这篇文章主要介绍了Python实现Pig Latin小游戏实例代码,分享了相关代码示例,小编觉得还是挺不错的,具有一定借鉴价值,需要的朋友可以参考下
    2018-02-02
  • python数据结构之线性表的顺序存储结构

    python数据结构之线性表的顺序存储结构

    这篇文章主要为大家详细介绍了python数据结构之线性表的顺序存储结构,具有一定的参考价值,感兴趣的小伙伴们可以参考一下
    2018-09-09
  • Python实现九宫格式的朋友圈功能内附“马云”朋友圈

    Python实现九宫格式的朋友圈功能内附“马云”朋友圈

    PIL(Python Imaging Library)是一个非常强大的Python库,但是它支持Python2.X, 在Python3中则使用的是Pillow库,它是从PIL中fork出来的一个分支。这篇文章主要介绍了用Python搞定九宫格式的朋友圈功能内附“马云”朋友圈 ,需要的朋友可以参考下
    2019-05-05
  • Keras神经网络efficientnet模型搭建yolov3目标检测平台

    Keras神经网络efficientnet模型搭建yolov3目标检测平台

    这篇文章主要为大家介绍了Keras利用efficientnet系列模型搭建yolov3目标检测平台的过程详解,有需要的朋友可以借鉴参考下,希望能够有所帮助,祝大家多多进步,早日升职加薪
    2022-05-05
  • TensorFlow设置日志级别的几种方式小结

    TensorFlow设置日志级别的几种方式小结

    今天小编就为大家分享一篇TensorFlow设置日志级别的几种方式小结,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2020-02-02
  • pytorch中 gpu与gpu、gpu与cpu 在load时相互转化操作

    pytorch中 gpu与gpu、gpu与cpu 在load时相互转化操作

    这篇文章主要介绍了pytorch模型载入之gpu和cpu互转操作,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
    2020-05-05
  • Django与图表的数据交互的实现

    Django与图表的数据交互的实现

    本文主要介绍了Django与图表的数据交互的实现,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2022-08-08
  • python能自学吗

    python能自学吗

    在本篇文章里小编给大家整理了关于python如何自学的相关理论性文章,有需要的朋友们可以参考下。
    2020-06-06

最新评论