Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IronPython 2.7.12 on Windows 11 | Unable to install package(s) through pip #832

Open
InfiniteBSOD opened this issue Mar 28, 2023 · 2 comments

Comments

@InfiniteBSOD
Copy link

Prerequisites

The issue tracker is used to report bugs and request new features, NOT to ask questions.

Questions should be posted to the users mailing list which can be accessed at
https://ironpython.groups.io/g/users.

  • [X ] Are you running the latest version?
  • [X ] Are you reporting to the correct repository?
  • [X ] Did you perform a cursory search?

Description

IronPython 2.7.12 (2.7.12.1000)
[.NETFramework,Version=v4.5 on .NET Framework 4.8.9139.0 (64-bit)]

Windows 11 Pro Ver 22H2 (OS Build: 22621.143)

Get-Command ipy

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     ipy.exe                                            0.0.0.0    C:\Program Files\IronPython 2.7\ipy.exe

ipy -m pip --version
returns:
pip 19.2.3 from C:\Program Files\IronPython 2.7\Lib\site-packages\pip (python 2.7)

Trying to install the "Axiom" package through pip.

  1. Issuing command in (an administrative-priviligied) PowerShell prompt:
    ipy -m pip install axiom
    which returns:
DEPRECATION: A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting axiom
ERROR: Exception:
Traceback (most recent call last):
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
    status = self.run(options, args)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\commands\install.py", line 345, in run
    resolver.resolve(requirement_set)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\legacy_resolve.py", line 195, in resolve
    discovered_reqs.extend(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\legacy_resolve.py", line 359, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\legacy_resolve.py", line 305, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\operations\prepare.py", line 134, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\req\req_install.py", line 211, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1200, in find_requirement
    candidates = self.find_candidates(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1183, in find_candidates
    candidates = self.find_all_candidates(project_name)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1131, in find_all_candidates
    page_versions.extend(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1339, in _package_versions
    for link in self._sort_links(links):
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1296, in _sort_links
    for link in links:
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1494, in iter_links
    document = html5lib.parse(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 47, in parse
    return p.parse(doc, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 289, in parse
    self._parse(stream, False, None, *args, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 130, in _parse
    self.tokenizer = _tokenizer.HTMLTokenizer(stream, parser=self, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_tokenizer.py", line 36, in __init__
    self.stream = HTMLInputStream(stream, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 151, in HTMLInputStream
    return HTMLBinaryInputStream(source, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 428, in __init__
    self.charEncoding = self.determineEncoding(useChardet)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 475, in determineEncoding
    charEncoding = self.detectEncodingMeta(), "tentative"
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 576, in detectEncodingMeta
    encoding = parser.getEncoding()
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 707, in getEncoding
    if self.data.matchBytes(key):
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 668, in matchBytes
    data = self[p:p + len(bytes)]
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

also tried:
ipy -X:Frames -m pip install axiom
which returns:

DEPRECATION: A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting axiom
ERROR: Exception:
Traceback (most recent call last):
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
    status = self.run(options, args)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\commands\install.py", line 345, in run
    resolver.resolve(requirement_set)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\legacy_resolve.py", line 195, in resolve
    discovered_reqs.extend(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\legacy_resolve.py", line 359, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\legacy_resolve.py", line 305, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\operations\prepare.py", line 134, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\req\req_install.py", line 211, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1200, in find_requirement
    candidates = self.find_candidates(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1183, in find_candidates
    candidates = self.find_all_candidates(project_name)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1131, in find_all_candidates
    page_versions.extend(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1339, in _package_versions
    for link in self._sort_links(links):
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1296, in _sort_links
    for link in links:
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1494, in iter_links
    document = html5lib.parse(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 47, in parse
    return p.parse(doc, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 289, in parse
    self._parse(stream, False, None, *args, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 130, in _parse
    self.tokenizer = _tokenizer.HTMLTokenizer(stream, parser=self, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_tokenizer.py", line 36, in __init__
    self.stream = HTMLInputStream(stream, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 151, in HTMLInputStream
    return HTMLBinaryInputStream(source, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 428, in __init__
    self.charEncoding = self.determineEncoding(useChardet)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 475, in determineEncoding
    charEncoding = self.detectEncodingMeta(), "tentative"
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 576, in detectEncodingMeta
    encoding = parser.getEncoding()
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 707, in getEncoding
    if self.data.matchBytes(key):
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 668, in matchBytes
    data = self[p:p + len(bytes)]
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

This is not limited to "axiom" since:
ipy -m pip install urllib3
returns the same issue:

DEPRECATION: A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting urllib3
ERROR: Exception:
Traceback (most recent call last):
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\cli\base_command.py", line 188, in main
    status = self.run(options, args)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\commands\install.py", line 345, in run
    resolver.resolve(requirement_set)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\legacy_resolve.py", line 195, in resolve
    discovered_reqs.extend(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\legacy_resolve.py", line 359, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\legacy_resolve.py", line 305, in _get_abstract_dist_for
    abstract_dist = self.preparer.prepare_linked_requirement(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\operations\prepare.py", line 134, in prepare_linked_requirement
    req.populate_link(finder, upgrade_allowed, require_hashes)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\req\req_install.py", line 211, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1200, in find_requirement
    candidates = self.find_candidates(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1183, in find_candidates
    candidates = self.find_all_candidates(project_name)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1131, in find_all_candidates
    page_versions.extend(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1339, in _package_versions
    for link in self._sort_links(links):
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1296, in _sort_links
    for link in links:
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_internal\index.py", line 1494, in iter_links
    document = html5lib.parse(
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 47, in parse
    return p.parse(doc, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 289, in parse
    self._parse(stream, False, None, *args, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\html5parser.py", line 130, in _parse
    self.tokenizer = _tokenizer.HTMLTokenizer(stream, parser=self, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_tokenizer.py", line 36, in __init__
    self.stream = HTMLInputStream(stream, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 151, in HTMLInputStream
    return HTMLBinaryInputStream(source, **kwargs)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 428, in __init__
    self.charEncoding = self.determineEncoding(useChardet)
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 475, in determineEncoding
    charEncoding = self.detectEncodingMeta(), "tentative"
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 576, in detectEncodingMeta
    encoding = parser.getEncoding()
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 707, in getEncoding
    if self.data.matchBytes(key):
  File "C:\Program Files\IronPython 2.7\Lib\site-packages\pip\_vendor\html5lib\_inputstream.py", line 668, in matchBytes
    data = self[p:p + len(bytes)]
TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

Steps to Reproduce

  1. Try to install any package through 'pip' using IronPython 2.6.12 on Windows 11 in an administrative PowerShell-prompt:
    ipy -m pip install <package>

Expected behavior:
Package installs

Actual behavior:
Package fails to install

Versions

IronPython 2.7.12 2.7.12.0 on .NET 4.0.30319.42000

@devmnj
Copy link

devmnj commented Jan 4, 2024

thi should work
`
image

`

@slozier
Copy link
Contributor

slozier commented Jan 12, 2024

Probably same issue as this: IronLanguages/ironpython3#1532

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants