如何修复pypy中的“Not ImplementedError: call from another thread”

How to fix "Not ImplementedError: call from another thread" in pypy

提问人:MHE 提问时间:9/2/2023 更新时间:9/2/2023 访问量:25

问:

我是Python的初学者。 当我在pypy中运行我的代码时,出现以下错误:

Exception in thread Thread-2 (process):
Traceback (most recent call last):
  File "F:\my folders\programming\pypy3.10-v7.3.12-win64\Lib\threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "F:\my folders\programming\pypy3.10-v7.3.12-win64\Lib\threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "F:\my folders\programming\pypy3.10-v7.3.12-win64\lib\site-packages\keyboard\_generic.py", line 58, in process
    if self.pre_process_event(event):
  File "F:\my folders\programming\pypy3.10-v7.3.12-win64\lib\site-packages\keyboard\__init__.py", line 218, in pre_process_event
    callback(event)
  File "F:\my folders\programming\pypy3.10-v7.3.12-win64\lib\site-packages\keyboard\__init__.py", line 649, in <lambda>
    handler = lambda e: (event_type == KEY_DOWN and e.event_type == KEY_UP and e.scan_code in _logically_pressed_keys) or (event_type == e.event_type and callback())
  File "F:\my folders\programming\PycharmProjects\untitled1\Strategy.py", line 6055, in Hotkey_remove_1
    remove_1()
  File "F:\my folders\programming\PycharmProjects\untitled1\Strategy.py", line 4928, in remove_1
    calculate_Adad()
  File "F:\my folders\programming\PycharmProjects\untitled1\Strategy.py", line 4775, in calculate_Adad
    exec("Len_" + str(i) + "_Label.config(text=" + str(tedad) + ")")
  File "<string>", line 1, in <module>
  File "F:\my folders\programming\pypy3.10-v7.3.12-win64\Lib\tkinter\__init__.py", line 1680, in configure
    return self._configure('configure', cnf, kw)
  File "F:\my folders\programming\pypy3.10-v7.3.12-win64\Lib\tkinter\__init__.py", line 1670, in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
  File "F:\my folders\programming\pypy3.10-v7.3.12-win64\Lib\_tkinter\app.py", line 313, in call
    raise NotImplementedError("Call from another thread")
NotImplementedError: Call from another thread

如何修复错误? 操作系统: Windows 蟒蛇:3.7 pypy:7.3.12

我在某处读到问题出在“tcl”上,我尝试安装“tcl-thread”包,但没有成功。 如果你的答案是安装“tcl-thread”包,请帮我如何安装它!

python windows 多线程 pypy

评论

1赞 Henry 9/2/2023
编辑您的问题,以包含一个最小的可重现示例
1赞 Community 9/2/2023
请提供足够的代码,以便其他人可以更好地理解或重现问题。
0赞 Armin Rigo 9/3/2023
可能相关:foss.heptapod.net/pypy/pypy/-/issues/3822

答: 暂无答案