⚡ Sangsakala Proxy 🏠 Home
Skip to content

pip can't be installed on Windows #5681

Description

@zzzy-zh86

It seems that pip cannot be installed on Windows.

Running `target\release\rustpython.exe --install-pip`
Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
  File "D:\code\rust\RustPython\Lib\runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "D:\code\rust\RustPython\Lib\runpy.py", line 94, in _run_module_code
    with _TempModule(mod_name) as temp_module, _ModifiedArgv0(fname):
  File "D:\code\rust\RustPython\Lib\runpy.py", line 97, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "D:\code\rust\RustPython\Lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\__main__.py", line 22, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\cli\main.py", line 10, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\cli\autocompletion.py", line 10, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\cli\main_parser.py", line 9, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\build_env.py", line 19, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\cli\spinners.py", line 9, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\utils\logging.py", line 29, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\utils\misc.py", line 41, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\locations\__init__.py", line 14, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\locations\_sysconfig.py", line 11, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\locations\base.py", line 9, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_internal\utils\appdirs.py", line 13, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_vendor\platformdirs\__init__.py", line 46, in <module>
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_vendor\platformdirs\__init__.py", line 26, in _set_platform_dir_class
  File "C:\Users\Yi\AppData\Local\Temp\tmpa005qsby\pip-23.2.1-py3-none-any.whl\pip\_vendor\platformdirs\windows.py", line 4, in <module>
  File "D:\code\rust\RustPython\Lib\ctypes\__init__.py", line 40, in <module>
    from _ctypes import _non_existing_function
ImportError: cannot import name '_non_existing_function'
Traceback (most recent call last):
  File "D:\code\rust\RustPython\Lib\runpy.py", line 197, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\code\rust\RustPython\Lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "D:\code\rust\RustPython\Lib\ensurepip\__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "D:\code\rust\RustPython\Lib\ensurepip\__init__.py", line 290, in _main
    default_pip=args.default_pip,
  File "D:\code\rust\RustPython\Lib\ensurepip\__init__.py", line 167, in _bootstrap
    with tempfile.TemporaryDirectory() as tmpdir:
  File "D:\code\rust\RustPython\Lib\ensurepip\__init__.py", line 200, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
  File "D:\code\rust\RustPython\Lib\ensurepip\__init__.py", line 101, in _run_pip
    return subprocess.run(cmd, check=True).returncode
  File "D:\code\rust\RustPython\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
  File "D:\code\rust\RustPython\Lib\subprocess.py", line 572, in run
    output=stdout, stderr=stderr)
CalledProcessError: (1, ['D:\\code\\rust\\RustPython\\target\\release\\rustpython.exe', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'C:\\\\Users\\\\Yi\\\\AppData\\\\Local\\\\Temp\\\\tmpa005qsby\\\\pip-23.2.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'C:\\\\Users\\\\Yi\\\\AppData\\\\Local\\\\Temp\\\\tmpa005qsby\', \'--upgrade\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n'])
error: process didn't exit successfully: `target\release\rustpython.exe --install-pip` (exit code: 1)
’‘’

Activity

  1. arihant2math commented on Apr 10, 2025

    @arihant2math
    Contributor

    Duplicate of #5332

  2. pushfoo commented on Oct 7, 2025

    @pushfoo

    I also see the ImportError: cannot import name '_non_existing_function on Debian 13. Would it be worth renaming this specific ticket to something ctypes-related?

  3. arihant2math commented on Oct 8, 2025

    @arihant2math
    Contributor

    that's intentional ... the idea is that ctypes isn't supposed to be imported and some polyfill is used instead.

  4. youknowone commented on Dec 5, 2025

    @youknowone
    Member

    #2671 will be the original issue of this

  5. youknowone commented on Dec 8, 2025

    @youknowone
    Member

    Good news: Now PIP is working on windows

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

    C-bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions