简体   繁体   English

cx-freeze exe中的TypeError

[英]TypeError in cx-freeze exe

im very new so pls dont hate.我很新,所以请不要讨厌。

I recently built my exe from my py with cx-freeze but when i open it, it shows this:我最近使用 cx-freeze 从我的 py 构建了我的 exe,但是当我打开它时,它显示:

Does anyone know how i can fix this?有谁知道我该如何解决这个问题?

    module.run()
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
    exec(code, {'__name__': '__main__'})
  File "Hellofresh.py", line 16, in <module>
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyfiglet\__init__.py", line 65, in figlet_format
    fig = Figlet(font, **kwargs)
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyfiglet\__init__.py", line 794, in __init__
    self.setFont()
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyfiglet\__init__.py", line 801, in setFont
    self.Font = FigletFont(font=self.font)
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyfiglet\__init__.py", line 126, in __init__
    self.data = self.preloadFont(font)
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pyfiglet\__init__.py", line 136, in preloadFont
    if pkg_resources.resource_exists('pyfiglet.fonts', fn):
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 1134, in resource_exists
    return get_provider(package_or_requirement).has_resource(resource_name)
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 364, in get_provider
    return _find_adapter(_provider_factories, loader)(module)
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\site-packages\pkg_resources\__init__.py", line 1392, in __init__
    self.module_path = os.path.dirname(getattr(module, '__file__', ''))
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\ntpath.py", line 223, in dirname
    return split(p)[0]
  File "C:\Users\Jakob\AppData\Local\Programs\Python\Python38-32\lib\ntpath.py", line 185, in split
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType```

I have also faced the same problem many times.我也多次遇到同样的问题。 To fix this you can uninstall XX freeze module by running the command:要解决此问题,您可以通过运行以下命令卸载 XX freeze 模块:

pip uninstall cx_freeze

And then reinstall the module by the command:然后通过以下命令重新安装模块:

pip install cx_freeze

Then your error might be fixed.那么你的错误可能会得到修复。 But if it is not fixed try reinstalling the Python.但如果没有修复,请尝试重新安装 Python。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM