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

Failed to get-pip on Windows #5146

Open
fu050409 opened this issue Jan 1, 2024 · 1 comment
Open

Failed to get-pip on Windows #5146

fu050409 opened this issue Jan 1, 2024 · 1 comment
Labels
C-bug Something isn't working

Comments

@fu050409
Copy link

fu050409 commented Jan 1, 2024

Summary

I followed the tutorial at https://rustpython.github.io/blog/2021/01/26/pip-support.html and tried to install pip, but some errors occured. I'm sure my rustpython has ssl feature enabled.

The first exception traceback mentioned below was the same as #5105, and a different error occured, I'm not sure if this is a new bug or not. If it's the same question, please forgive my recklessness.

Expected

According to the tutorial it should start automatically downloading the whl file for pip.

Actual

When I was running rustpython get-pip.py, I got:

Traceback (most recent call last):
  File "get-pip.py", line 33024, 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 "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_internal\commands\__init__.py", line 9, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_internal\cli\base_command.py", line 15, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_internal\cli\cmdoptions.py", line 24, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_internal\cli\parser.py", line 12, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_internal\configuration.py", line 20, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_internal\exceptions.py", line 18, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_vendor\requests\__init__.py", line 43, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_vendor\urllib3\__init__.py", line 13, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_vendor\urllib3\connectionpool.py", line 39, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmpjqc586od\pip.zip\pip\_vendor\urllib3\request.py", line 191, in <module>
TypeError: __class__ assignment only supported for types without a payload

And I found a same issue in #5105.

After that, I tried to install pip via command rustpython --install-pip instead of using get-pip.py, but another error occured:

Traceback (most recent call last):
  File "<stdin>", line 6, in <module>
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\runpy.py", line 224, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\runpy.py", line 94, in _run_module_code
    with _TempModule(mod_name) as temp_module, _ModifiedArgv0(fname):
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\runpy.py", line 97, in _run_module_code
    mod_name, mod_spec, pkg_name, script_name)
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\__main__.py", line 29, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\cli\main.py", line 9, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\cli\autocompletion.py", line 10, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\cli\main_parser.py", line 9, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\build_env.py", line 20, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\cli\spinners.py", line 9, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\utils\logging.py", line 29, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\utils\misc.py", line 42, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\locations\__init__.py", line 14, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\locations\_sysconfig.py", line 11, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\locations\base.py", line 9, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_internal\utils\appdirs.py", line 13, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_vendor\platformdirs\__init__.py", line 42, in <module>
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_vendor\platformdirs\__init__.py", line 21, in _set_platform_dir_class
  File "C:\Users\fu050\AppData\Local\Temp\tmppk4bac23\pip-22.3.1-py3-none-any.whl\pip\_vendor\platformdirs\windows.py", line 3, in <module>
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Traceback (most recent call last):
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\runpy.py", line 197, in _run_module_as_main
    "__main__", mod_spec)
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\ensurepip\__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\ensurepip\__init__.py", line 292, in _main
    default_pip=args.default_pip,
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\ensurepip\__init__.py", line 169, in _bootstrap
    with tempfile.TemporaryDirectory() as tmpdir:
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\ensurepip\__init__.py", line 202, in _bootstrap
    return _run_pip([*args, *_PACKAGE_NAMES], additional_paths)
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\ensurepip\__init__.py", line 103, in _run_pip
    return subprocess.run(cmd, check=True).returncode
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
  File "\\?\C:\Users\fu050\.cargo\git\checkouts\rustpython-f8ef4d934ac33cd8\317f449\Lib\subprocess.py", line 572, in run
    output=stdout, stderr=stderr)
CalledProcessError: (1, ['C:\\Users\\fu050\\.cargo\\bin\\rustpython.exe', '-I', '-W', 'ignore::DeprecationWarning', '-c', '\nimport runpy\nimport sys\nsys.path = [\'C:\\\\Users\\\\fu050\\\\AppData\\\\Local\\\\Temp\\\\tmppk4bac23\\\\setuptools-65.5.0-py3-none-any.whl\', \'C:\\\\Users\\\\fu050\\\\AppData\\\\Local\\\\Temp\\\\tmppk4bac23\\\\pip-22.3.1-py3-none-any.whl\'] + sys.path\nsys.argv[1:] = [\'install\', \'--no-cache-dir\', \'--no-index\', \'--find-links\', \'C:\\\\Users\\\\fu050\\\\AppData\\\\Local\\\\Temp\\\\tmppk4bac23\', \'--upgrade\', \'setuptools\', \'pip\']\nrunpy.run_module("pip", run_name="__main__", alter_sys=True)\n'])

A different error was thrown, so I opened a new issue.

@fu050409 fu050409 added the C-bug Something isn't working label Jan 1, 2024
@fu050409
Copy link
Author

fu050409 commented Jan 1, 2024

I tried again in different Linux platform, CentOS and Ubuntu, a same error occured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant