pycharm使用pyinstaller模块打包提示错误解决方法

发布于 / 经验教程 / 0 条评论

提示如下:

 Traceback (most recent call last):
  File "C:\Users\user\Desktop\untitled1\venv\Scripts\pyinstaller-script.py", line 11, in  <module>
    load_entry_point('PyInstaller==3.4', 'console_scripts', 'pyinstaller')()
  File "C:\Users\user\Desktop\untitled1\venv\lib\site-packages\PyInstaller\__main__.py", line 111, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "C:\Users\user\Desktop\untitled1\venv\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "C:\Users\user\Desktop\untitled1\venv\lib\site- packages\PyInstaller\building\build_main.py", line 838, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))   
  File "C:\Users\user\Desktop\untitled1\venv\lib\site- packages\PyInstaller\building\build_main.py", line 784, in build
    exec(text, spec_namespace)
  File "<string>", line 29, in <module>   
  File "C:\Users\user\Desktop\untitled1\venv\lib\site-packages\PyInstaller\building\api.py", line 424, in __init__
    strip_binaries=self.strip, upx_binaries=self.upx,   
  File "C:\Users\user\Desktop\untitled1\venv\lib\site-packages\PyInstaller\building\api.py", line 196, in __init__
    self.__postinit__()
  File "C:\Users\user\Desktop\untitled1\venv\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
    self.assemble()   
  File "C:\Users\user\Desktop\untitled1\venv\lib\site-packages\PyInstaller\building\api.py", line 273, in assemble
    pylib_name = os.path.basename(bindepend.get_python_library_path())   
  File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\ntpath.py", line 214, in basename
    return split(p)[1]
  File "C:\Users\user\AppData\Local\Programs\Python\Python37\lib\ntpath.py", line 183, in split
    p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType 

解决办法:

1、下载bindepend.py文件

2、将该文件放入并替换这个目录下的文件

C:\xxx\venv\Lib\site-packages\PyInstaller\depend

转载原创文章请注明,转载自: 佐木网络 » pycharm使用pyinstaller模块打包提示错误解决方法
Not Comment Found