Dar*_*inx 14 python pip modulenotfounderror customtkinter python-3.12
当我尝试customtkinter在 Python 3.12 中导入时,出现以下错误:
File "c:\Users\judel\OneDrive\Documents\Python\main.py", line 1, in <module>
import customtkinter as ttk
File "C:\Users\judel\AppData\Local\Programs\Python\Python312\Lib\site-packages\customtkinter\__init__.py", line 10, in <module>
from .windows.widgets.appearance_mode import AppearanceModeTracker
File "C:\Users\judel\AppData\Local\Programs\Python\Python312\Lib\site-packages\customtkinter\windows\__init__.py", line 1, in <module>
from .ctk_tk import CTk
File "C:\Users\judel\AppData\Local\Programs\Python\Python312\Lib\site-packages\customtkinter\windows\ctk_tk.py", line 2, in <module>
from distutils.version import StrictVersion as Version
ModuleNotFoundError: No module named 'distutils'
Run Code Online (Sandbox Code Playgroud)
为什么会发生这种情况?为什么找不到标准库中的模块?
Bri*_*ian 31
看来customtkinter使用的distutils是标准库。
不幸的是,您使用的是新发布的 Python 3.12,该版本distutils自 Python 3.10 起被弃用后被删除。有关删除的更多详细信息,请参阅PEP 632 弃用 distutils 模块和gh-92584 。
如果您想使用该发行版,您需要
setuptools,现在还提供distutils,或distutils来自第三方源的旁加载(例如系统包,如apt install python3-distutils),或| 归档时间: |
|
| 查看次数: |
23023 次 |
| 最近记录: |