-------------- AttributeError Traceback (most recent call last) <ipython-input-1-81e6cd932f6b> in <module> 13 14 # 设置字体 ---> 15 fontStyle = font.Font(family="楷体", size=16) 16 17 class MachineLearningApp: D:\Program Files\a\lib\tkinter\font.py in __init__(self, root, font, name, exists, **options) 91 else: 92 # create new font (raises TclError if the font exists) ---> 93 tk.call("font", "create", self.name, *font) 94 self.delete_font = True 95 self._tk = tk AttributeError: 'NoneType' object has no attribute 'call'这个错误怎么改
时间: 2023-11-30 12:03:25 浏览: 45
这个错误可能是因为 tkinter 模块没有正确导入或安装。你可以尝试重新安装 tkinter 模块,或者检查代码中是否有其他部分影响了 tkinter 的导入。另外,也可以尝试在代码中添加以下导入语句,以确保 tkinter 正确导入:
```python
import tkinter as tk
from tkinter import font
```
如果仍然无法解决问题,请提供更多代码和错误信息,以便更好地帮助你。
相关问题
AttributeError Traceback (most recent call last) <ipython-input-26-7401c2f31978> in <module>
It seems like you are trying to run some code in Python and getting an `AttributeError`. Can you please provide more information about the error, such as the full traceback and the code that you are running?
AttributeError Traceback (most recent call last) <ipython-input-18-484e38e099dc> in <module>() 1 from sklearn import preprocessing ----> 2 minmiax_scale = preprocessing.MinMaxSacler((0,1)) AttributeError: module 'sklearn.preprocessing' has no attribute 'MinMaxSacler'
您好!根据错误信息,看起来是由于您拼写错误导致的。正确的类名应该是 `MinMaxScaler` 而不是 `MinMaxSacler`。请修改代码如下:
```python
from sklearn import preprocessing
minmax_scale = preprocessing.MinMaxScaler((0,1))
```
请注意修改后的代码中的 `MinMaxScaler` 拼写正确。如果还有其他问题,请随时提问。