This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: "make venv" failed in Docs
Type: behavior Stage: resolved
Components: Documentation Versions: Python 3.8
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: brett.cannon, docs@python, hugovk, mdk, ned.deily, pitrou, xtreak
Priority: critical Keywords:

Created on 2019-05-04 17:48 by pitrou, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg341395 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2019-05-04 17:48
$ make venv
python3 -m venv ./venv
./venv/bin/python3 -m pip install -U Sphinx blurb python-docs-theme
/home/antoine/cpython/default/Doc/venv/share/python-wheels/requests-2.18.4-py2.py3-none-any.whl/requests/__init__.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn't match a supported version!
Collecting Sphinx
  Cache entry deserialization failed, entry ignored
Exception:
Traceback (most recent call last):
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/commands/install.py", line 353, in run
    wb.build(autobuilding=True)
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 811, in get_page
    inst = cls(resp.content, resp.url, resp.headers)
  File "/home/antoine/cpython/default/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 731, in __init__
    namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument 'transport_encoding'
Makefile:126: recipe for target 'venv' failed
make: *** [venv] Error 2
msg341398 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-05-04 19:13
Could it be a problem with pip and it's vendored html5lib version incompatibility? There is one bug report in pip repo about Anaconda patching pip that seems to cause this error : https://github.com/pypa/pip/issues/4902 .

Can you please share the pip and python version to see if I can reproduce this? Is the pip being used part of the one at 3.6 release?

./venv/bin/pip --version

I am using Python 3.6.4 from homebrew. I can reproduce this is by manually editing ./venv/lib/python3.6/site-packages/pip/_vendor/html5lib/_inputstream.py and removing transport_encoding from HTMLBinaryInputStream's constructor. 

./venv/lib/python3.6/site-packages/pip/_vendor/html5lib/__init__.py contains the version number of html5lib. Mine is 1.0b10. 

Sample error I got similar to the report : 

➜  Doc git:(master) ✗ ./venv/bin/pip install sphinx
Collecting sphinx
Exception:
Traceback (most recent call last):
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/req/req_set.py", line 554, in _prepare_file
    require_hashes
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/req/req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 811, in get_page
    inst = cls(resp.content, resp.url, resp.headers)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/index.py", line 731, in __init__
    namespaceHTMLElements=False,
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/_vendor/html5lib/html5parser.py", line 35, in parse
    return p.parse(doc, **kwargs)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/_vendor/html5lib/html5parser.py", line 235, in parse
    self._parse(stream, False, None, *args, **kwargs)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/_vendor/html5lib/html5parser.py", line 85, in _parse
    self.tokenizer = _tokenizer.HTMLTokenizer(stream, parser=self, **kwargs)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/_vendor/html5lib/_tokenizer.py", line 36, in __init__
    self.stream = HTMLInputStream(stream, **kwargs)
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Doc/venv/lib/python3.6/site-packages/pip/_vendor/html5lib/_inputstream.py", line 151, in HTMLInputStream
    return HTMLBinaryInputStream(source, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'transport_encoding'
You are using pip version 9.0.1, however version 19.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
msg416845 - (view) Author: Hugo van Kemenade (hugovk) * (Python triager) Date: 2022-04-06 08:24
I cannot reproduce this (macOS, Python 3.10, pip 22.0.4).

As xtreak said, it's probably caused by using a very old version of pip (9.0.1 from Nov 6, 2016), so let's close it.

Please let us know if it happens again, and whether updating pip helps.
History
Date User Action Args
2022-04-11 14:59:14adminsetgithub: 80976
2022-04-06 08:24:20hugovksetstatus: open -> closed

nosy: + hugovk
messages: + msg416845

stage: needs patch -> resolved
2019-05-04 19:14:00xtreaksetnosy: + xtreak
messages: + msg341398
2019-05-04 18:07:09ned.deilysetnosy: + mdk
2019-05-04 17:48:38pitroucreate