Skip to content

get-pip fails on ubuntu #5105

Closed
Closed

Description

@iHnR

Summary

The command rustpython --install-pip get-pip fails with an error I haven't found elsewhere. I installed rustpyton with cargo install --git https://github.com/RustPython/RustPython --features ssl
The rest of rustpython seems to work fine.

Expected

pip installs

Actual

This is the error message:

downloading get-pip.py...
running get-pip.py...
Traceback (most recent call last):
  File "get-pip.py", line 32992, in <module>
    main()
  File "get-pip.py", line 139, in main
    shutil.rmtree(tmpdir, ignore_errors=True)
  File "get-pip.py", line 135, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 135, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 111, in bootstrap
    monkeypatch_for_cert(tmpdir)
  File "get-pip.py", line 92, in monkeypatch_for_cert
    from pip._internal.commands.install import InstallCommand
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_internal/commands/__init__.py", line 9, in <module>
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_internal/cli/base_command.py", line 15, in <module>
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_internal/cli/cmdoptions.py", line 24, in <module>
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_internal/cli/parser.py", line 12, in <module>
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_internal/configuration.py", line 20, in <module>
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_internal/exceptions.py", line 18, in <module>
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_vendor/requests/__init__.py", line 43, in <module>
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_vendor/urllib3/__init__.py", line 13, in <module>
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_vendor/urllib3/connectionpool.py", line 39, in <module>
  File "/tmp/tmp_7cqaye7/pip.zip/pip/_vendor/urllib3/request.py", line 191, in <module>
TypeError: __class__ assignment only supported for types without a payload

Python Documentation

Activity

  1. added
    C-compatA discrepancy between RustPython and CPython
    A-vmArea: virtual machine
    on Oct 30, 2023
  2. rominf commented on Dec 6, 2023

    @rominf

    I have a similar issue. I can install pip using this command only (with rustpython installed using cargo with --features=ssl):

    $ rustpython --install-pip ensurepip --user
    

    However pip update doesn't work and I am not able to install any package (same error):

    $ rustpython -m pip install setuptools
    Traceback (most recent call last):
      File "/home/rominf/.cargo/git/checkouts/rustpython-f8ef4d934ac33cd8/0fab6e6/pylib/Lib/runpy.py", line 197, in _run_module_as_main
        "__main__", mod_spec)
      File "/home/rominf/.cargo/git/checkouts/rustpython-f8ef4d934ac33cd8/0fab6e6/pylib/Lib/runpy.py", line 86, in _run_code
        exec(code, run_globals)
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/__main__.py", line 22, in <module>
        from pip._internal.cli.main import main as _main
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_internal/cli/main.py", line 10, in <module>
        from pip._internal.cli.autocompletion import autocomplete
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
        from pip._internal.cli.main_parser import create_main_parser
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_internal/cli/main_parser.py", line 9, in <module>
        from pip._internal.build_env import get_runnable_pip
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_internal/build_env.py", line 19, in <module>
        from pip._internal.cli.spinners import open_spinner
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_internal/cli/spinners.py", line 9, in <module>
        from pip._internal.utils.logging import get_indentation
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_internal/utils/logging.py", line 29, in <module>
        from pip._internal.utils.misc import ensure_dir
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_internal/utils/misc.py", line 43, in <module>
        from pip._internal.exceptions import CommandError, ExternallyManagedEnvironment
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_internal/exceptions.py", line 18, in <module>
        from pip._vendor.requests.models import Request, Response
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_vendor/requests/__init__.py", line 43, in <module>
        from pip._vendor import urllib3
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_vendor/urllib3/__init__.py", line 13, in <module>
        from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_vendor/urllib3/connectionpool.py", line 39, in <module>
        from .request import RequestMethods
      File "/home/rominf/.local/lib/rustpython3.12/site-packages/pip/_vendor/urllib3/request.py", line 191, in <module>
        sys.modules[__name__].__class__ = RequestModule
    TypeError: __class__ assignment only supported for types without a payload
    
  3. rtbs-dev commented on Jan 15, 2024

    @rtbs-dev

    Finding exactly this bug on Arch. Just updated via rustup too.

  4. youknowone commented on May 20, 2024

    @youknowone
    Member

    fixed by #5225

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-vmArea: virtual machineC-bugSomething isn't workingC-compatA discrepancy between RustPython and CPython

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions