完美解决安装完tensorflow后pip无法使用的问题
Win8,ANACONDA3(64-bit),Python3.6.2。ANACONDAPrompt中不能用pip命令安装包,并且是在安装了TensorFlow后才发生的。
报错如下:
F:\360Downloads>pipinstall--upgradepip Exception: Traceback(mostrecentcalllast): File"E:\tools\anaconda\py3\lib\site-packages\pip\basecommand.py",line215,inmain status=self.run(options,args) File"E:\tools\anaconda\py3\lib\site-packages\pip\commands\install.py",line335,inrun wb.build(autobuilding=True) File"E:\tools\anaconda\py3\lib\site-packages\pip\wheel.py",line749,inbuild self.requirement_set.prepare_files(self.finder) File"E:\tools\anaconda\py3\lib\site-packages\pip\req\req_set.py",line380,inprepare_files ignore_dependencies=self.ignore_dependencies)) File"E:\tools\anaconda\py3\lib\site-packages\pip\req\req_set.py",line487,in_prepare_file req_to_install,finder) File"E:\tools\anaconda\py3\lib\site-packages\pip\req\req_set.py",line428,in_check_skip_instal led req_to_install,upgrade_allowed) File"E:\tools\anaconda\py3\lib\site-packages\pip\index.py",line465,infind_requirement all_candidates=self.find_all_candidates(req.name) File"E:\tools\anaconda\py3\lib\site-packages\pip\index.py",line423,infind_all_candidates forpageinself._get_pages(url_locations,project_name): File"E:\tools\anaconda\py3\lib\site-packages\pip\index.py",line568,in_get_pages page=self._get_page(location) File"E:\tools\anaconda\py3\lib\site-packages\pip\index.py",line683,in_get_page returnHTMLPage.get_page(link,session=self.session) File"E:\tools\anaconda\py3\lib\site-packages\pip\index.py",line811,inget_page inst=cls(resp.content,resp.url,resp.headers) File"E:\tools\anaconda\py3\lib\site-packages\pip\index.py",line731,in__init__ namespaceHTMLElements=False, TypeError:parse()gotanunexpectedkeywordargument'transport_encoding'
解决方案:
1.condainstall-canacondahtml5lib
如下场景
F:\360Downloads>condainstall-canacondahtml5lib Fetchingpackagemetadata............... Solvingpackagespecifications:. PackageplanforinstallationinenvironmentE:\tools\anaconda\py3: ThefollowingpackageswillbeUPDATED: anaconda:5.0.0-py36hea9b2fc_0-->custom-py36h363777c_0anaconda bzip2:1.0.6-vc14hdec8e7a_1-->1.0.6-vc14_3anaconda[vc14] conda:4.3.27-py36hcbae3bd_0-->4.4.8-py36_0anaconda html5lib:0.999999999-py36ha09b1f3_0-->1.0.1-py36h047fa9f_0anaconda libpng:1.6.32-vc14hce43e6c_2-->1.6.32-vc14h5163883_3anaconda[vc14] openssl:1.0.2l-vc14hcac20b0_2-->1.0.2l-vc14hf4c37d5_5anaconda[vc14] pycosat:0.6.2-py36hf17546d_1-->0.6.3-py36h413d8a4_0anaconda ThefollowingpackageswillbeSUPERSEDEDbyahigher-prioritychannel: conda-env:2.6.0-h36134e3_1-->2.6.0-h36134e3_1anaconda curl:7.55.1-vc14hdaba4a4_3-->7.55.1-vc14hdaba4a4_3anaconda[vc14] freetype:2.8-vc14h17c9bdf_0-->2.8-vc14h17c9bdf_0anaconda[vc14] hdf5:1.10.1-vc14hb361328_0-->1.10.1-vc14hb361328_0anaconda[vc14] icu:58.2-vc14hc45fdbb_0-->58.2-vc14hc45fdbb_0anaconda[vc14] jpeg:9b-vc14h4d7706e_1-->9b-vc14h4d7706e_1anaconda[vc14] libiconv:1.15-vc14h29686d3_5-->1.15-vc14h29686d3_5anaconda[vc14] libssh2:1.8.0-vc14hcf584a9_2-->1.8.0-vc14hcf584a9_2anaconda[vc14] libtiff:4.0.8-vc14h04e2a1e_10-->4.0.8-vc14h04e2a1e_10anaconda[vc14] libxml2:2.9.4-vc14h8fd0f11_5-->2.9.4-vc14h8fd0f11_5anaconda[vc14] libxslt:1.1.29-vc14hf85b8d4_5-->1.1.29-vc14hf85b8d4_5anaconda[vc14] qt:5.6.2-vc14h6f8c307_12-->5.6.2-vc14h6f8c307_12anaconda[vc14] sqlite:3.20.1-vc14h7ce8c62_1-->3.20.1-vc14h7ce8c62_1anaconda[vc14] tk:8.6.7-vc14hb68737d_1-->8.6.7-vc14hb68737d_1anaconda[vc14] yaml:0.1.7-vc14hb31d195_1-->0.1.7-vc14hb31d195_1anaconda[vc14] zlib:1.2.11-vc14h1cdd9ab_1-->1.2.11-vc14h1cdd9ab_1anaconda[vc14] Proceed([y]/n)?y conda-env-2.6.100%|###############################|Time:0:00:00538.73kB/s bzip2-1.0.6-vc100%|###############################|Time:0:00:0255.75kB/s icu-58.2-vc14h7%|##|Time:0:00:07233.63kB/s
2.更新:condainstallpip
以上这篇完美解决安装完tensorflow后pip无法使用的问题就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持毛票票。