Summary
upgrading to pip==25.1.1 on macOS breaks rustpython -m pip (works with CPython 3.9.6 (builtin) and CPython 3.13.5 (stable) )
Details
...
File "/User/username/.local/lib/rustpython3.13/site-packages/pip/_internal/utils/misc.py", line 44, in <module>
from pip._internal.utils.retry import retry
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_internal/utils/retry.py", line 8, in <module>
P = ParamSpec("P")
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_vendor/typing_extensions.py", line 1768, in __new__
_set_default(paramspec, default)
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_vendor/typing_extensions.py", line 1613, in _set_default
type_param.__default__ = default
AttributeError: attribute '__default__' of 'ParamSpec' objects is not writable
Full steps to reproduce on macOS
- (optional) cleanup and reset rustpython pip:
cargo uninstall rustpython || :
rm -vf ~/.local/bin/pip3.13 || :
rm -vf ~/.local/bin/pip || :
rm -vf ~/.local/bin/pip3 || :
rm -vfRd ~/.local/lib/rustpython3.13 || :
- install rustpython with ssl via cargo (using homebrew's rustc/cargo)
cargo install --git https://github.com/RustPython/RustPython rustpython --features ssl --features jit
- Bootstrap pip with rustpython
May see issues if not privileged (normal even with reference cPython)
e.g.,
$ rustpython --install-pip
Defaulting to user installation because normal site-packages is not writeable
...
Installing collected packages: pip
Successfully installed pip-23.2.1
- Test pip is initially working:
$ rustpython -m pip list
Package Version
------- -------
pip 23.2.1
[notice] A new release of pip is available: 23.2.1 -> 25.1.1
[notice] To update, run: rustpython -m pip install --upgrade pip
- run the reccomended update command
rustpython -m pip install --upgrade pip
May again see privilege warning (again normal even in reference cPython)
e.g.,
$ rustpython -m pip install --upgrade pip
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /Users/username/.local/lib/rustpython3.13/site-packages (23.2.1)
Collecting pip
Obtaining dependency information for pip from https://files.pythonhosted.org/packages/29/a2/d40fb2460e883eca5199c62cfc2463fd261f760556ae6290f88488c362c0/pip-25.1.1-py3-none-any.whl.metadata
Using cached pip-25.1.1-py3-none-any.whl.metadata (3.6 kB)
Using cached pip-25.1.1-py3-none-any.whl (1.8 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 23.2.1
Uninstalling pip-23.2.1:
Successfully uninstalled pip-23.2.1
Successfully installed pip-25.1.1
- attempt to use pip with rustpython and see error:
See error:
$ rustpython -m pip list
Traceback (most recent call last):
File "/Users/amak/.cargo/git/checkouts/rustpython-63090cdce5e18442/c195473/pylib/Lib/runpy.py", line 197, in _run_module_as_main
"__main__", mod_spec)
File "/Users/amak/.cargo/git/checkouts/rustpython-63090cdce5e18442/c195473/pylib/Lib/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/__main__.py", line 22, in <module>
from pip._internal.cli.main import main as _main
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/main.py", line 10, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/Users/amak/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/autocompletion.py", line 9, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
from pip._internal.build_env import get_runnable_pip
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_internal/build_env.py", line 16, in <module>
from pip._internal.cli.spinners import open_spinner
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_internal/cli/spinners.py", line 9, in <module>
from pip._internal.utils.logging import get_indentation
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_internal/utils/logging.py", line 29, in <module>
from pip._internal.utils.misc import ensure_dir
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_internal/utils/misc.py", line 44, in <module>
from pip._internal.utils.retry import retry
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_internal/utils/retry.py", line 8, in <module>
P = ParamSpec("P")
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_vendor/typing_extensions.py", line 1768, in __new__
_set_default(paramspec, default)
File "/Users/username/.local/lib/rustpython3.13/site-packages/pip/_vendor/typing_extensions.py", line 1613, in _set_default
type_param.__default__ = default
AttributeError: attribute '__default__' of 'ParamSpec' objects is not writable
END
$ rustc --version
rustc 1.88.0 (6b00bc388 2025-06-23) (Homebrew)
$ rustpython --version
Python 3.13.0alpha (heads/master:c195473a2, Jul 8 2025, 07:49:57)
[RustPython 0.4.0 with rustc 1.88.0 (6b00bc388 2025-06-23) (Homebrew)]
Also probably related to GHI #5332
Note
Possibly a regression or variant:
I'm seeing Similar AttributeError as before on MacOS but with: type_param.__default__
Summary
upgrading to pip==25.1.1 on macOS breaks rustpython -m pip (works with CPython 3.9.6 (builtin) and CPython 3.13.5 (stable) )
Details
Full steps to reproduce on macOS
May see issues if not privileged (normal even with reference cPython)
e.g.,
May again see privilege warning (again normal even in reference cPython)
e.g.,
See error:
END
Also probably related to GHI #5332