Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
472 views
in Technique[技术] by (71.8m points)

python - pip throws TypeError: parse() got an unexpected keyword argument 'transport_encoding' when trying to install new packages

I am using the latest version of Anaconda3. I just installed it and I am trying to download some packages. I am using the Anaconda Prompt. While trying to use pip to do anything (including upgrading existing packages) I get the following traceback.

    Exception:
Traceback (most recent call last):
  File "C:UserscsprockAnaconda3libsite-packagespipasecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:UserscsprockAnaconda3libsite-packagespipcommandsinstall.py", line 335, in run
    wb.build(autobuilding=True)
  File "C:UserscsprockAnaconda3libsite-packagespipwheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "C:UserscsprockAnaconda3libsite-packagespip
eq
eq_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:UserscsprockAnaconda3libsite-packagespip
eq
eq_set.py", line 487, in _prepare_file
    req_to_install, finder)
  File "C:UserscsprockAnaconda3libsite-packagespip
eq
eq_set.py", line 428, in _check_skip_installed
    req_to_install, upgrade_allowed)
  File "C:UserscsprockAnaconda3libsite-packagespipindex.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "C:UserscsprockAnaconda3libsite-packagespipindex.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "C:UserscsprockAnaconda3libsite-packagespipindex.py", line 568, in _get_pages
    page = self._get_page(location)
  File "C:UserscsprockAnaconda3libsite-packagespipindex.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "C:UserscsprockAnaconda3libsite-packagespipindex.py", line 811, in get_page
    inst = cls(resp.content, resp.url, resp.headers)
  File "C:UserscsprockAnaconda3libsite-packagespipindex.py", line 731, in __init__
    namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument 'transport_encoding'

Any ideas? (this problem only started after I installed tensorflow) Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I had the same problem and what worked for me was updating pip with conda:

conda install pip

It changed my pip from 9.0.1-py36hadba87b_3 to 9.0.1-py36h226ae91_4 and solved issue.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...