使用Flexx的Python无法从“base64”导入名称“encodestring”

2024-09-30 12:20:39 发布

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

我想用Python和Flexx制作一个GUI,它看起来是一个很好的框架,所以我阅读了文档并在那里开始了教程。我复制了第一个示例中的代码:

from flexx import flx

class Example(flx.Widget):

   def init(self):
       flx.Button(text='hello')
       flx.Button(text='world')

当运行该代码时,我得到了错误

File "C:\Users\axeld\AppData\Local\Programs\Python\Python39\lib\site-packages\flexx\flx.py", line 10, in <module>
    from .app import *
  File "C:\Users\axeld\AppData\Local\Programs\Python\Python39\lib\site-packages\flexx\app\__init__.py", line 38, in <module>
    from ._app import App, manager
  File "C:\Users\axeld\AppData\Local\Programs\Python\Python39\lib\site-packages\flexx\app\_app.py", line 11, in <module>
    from base64 import encodestring as encodebytes
ImportError: cannot import name 'encodestring' from 'base64' (C:\Users\axeld\AppData\Local\Programs\Python\Python39\lib\base64.py)

不知道为什么会发生,也不知道如何修复。请帮忙


Tags: frompyimportappliblocalsiteusers

热门问题