如何修复'ctypes.ArgumentError:参数1:<class'TypeError'>:应为LP\u ulong实例,而不是LP\u SECURITY_属性

2024-09-28 01:32:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图通过为django项目运行命令python manage.pyshell来打开IPythonshell,但是没有得到预期的输出。相反,我得到了一些奇怪的东西。在

我试着跑了两次,但同样的事情一次又一次地发生。在

以及我收到的错误

Traceback (most recent call last):
  File "manage.py", line 21, in <module>
    main()
  File "manage.py", line 17, in main
    execute_from_command_line(sys.argv)
  File "c:\users\khyati\django\django\core\management\__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "c:\users\khyati\django\django\core\management\__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "c:\users\khyati\django\django\core\management\base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "c:\users\khyati\django\django\core\management\base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "c:\users\khyati\django\django\core\management\commands\shell.py", line 99, in handle
    return getattr(self, shell)(options)
  File "c:\users\khyati\django\django\core\management\commands\shell.py", line 36, in ipython
    start_ipython(argv=[])
  File "C:\Users\khyati\Anaconda3\lib\site-packages\IPython\__init__.py", line 125, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "C:\Users\khyati\Anaconda3\lib\site-packages\traitlets\config\application.py", line 657, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-113>", line 2, in initialize
  File "C:\Users\khyati\Anaconda3\lib\site-packages\traitlets\config\application.py", line 87, in catch_config_error
    return method(app, *args, **kwargs)
  File "C:\Users\khyati\Anaconda3\lib\site-packages\IPython\terminal\ipapp.py", line 317, in initialize
    self.init_shell()
  File "C:\Users\khyati\Anaconda3\lib\site-packages\IPython\terminal\ipapp.py", line 333, in init_shell
    ipython_dir=self.ipython_dir, user_ns=self.user_ns)
  File "C:\Users\khyati\Anaconda3\lib\site-packages\traitlets\config\configurable.py", line 412, in instance
    inst = cls(*args, **kwargs)
  File "C:\Users\khyati\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 431, in __init__
    self.init_prompt_toolkit_cli()
  File "C:\Users\khyati\Anaconda3\lib\site-packages\IPython\terminal\interactiveshell.py", line 281, in init_prompt_toolkit_cli
    self._eventloop = create_eventloop(self.inputhook)
  File "C:\Users\khyati\Anaconda3\lib\site-packages\prompt_toolkit\shortcuts.py", line 95, in create_eventloop
    return Loop(inputhook=inputhook, recognize_paste=recognize_win32_paste)
  File "C:\Users\khyati\Anaconda3\lib\site-packages\prompt_toolkit\eventloop\win32.py", line 39, in __init__
    self._event = _create_event()
  File "C:\Users\khyati\Anaconda3\lib\site-packages\prompt_toolkit\eventloop\win32.py", line 187, in _create_event
    return windll.kernel32.CreateEventA(pointer(SECURITY_ATTRIBUTES()), BOOL(True), BOOL(False), None)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: expected LP_c_ulong instance instead of LP_SECURITY_ATTRIBUTES

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    c.Application.verbose_crash=True

Python 3.x.x(v3.x.x: ........)
Type 'copyright', 'credits' or 'license' for more information
IPython x.x.x -- An enhanced Interactive Python. Type '?' for help.

任何帮助都将不胜感激。顺便说一句,我用的是Windows


Tags: djangoinpyselfinitlibpackagesipython

热门问题