Pyinstaller封装exe-TypeError: expected str, bytes or os.PathLike object, not NoneType

用Pyinstaller封装exe时出现错误:TypeError: expected str, bytes or os.PathLike object, not NoneType

环境: Ubuntu 16  python3.6 

58477 INFO: Loading module hook "hook-gevent.monkey.py"...
58612 INFO: Looking for ctypes DLLs
58982 WARNING: library user32 required via ctypes not found
59330 INFO: Analyzing run-time hooks ...
59365 INFO: Including run-time hook 'pyi_rth__tkinter.py'
59367 INFO: Including run-time hook 'pyi_rth_multiprocessing.py'
59370 INFO: Including run-time hook 'pyi_rth_pkgres.py'
59371 INFO: Including run-time hook 'pyi_rth_traitlets.py'
59372 INFO: Including run-time hook 'pyi_rth_qt5.py'
59373 INFO: Including run-time hook 'pyi_rth_mplconfig.py'
59374 INFO: Including run-time hook 'pyi_rth_mpldata.py'
59437 INFO: Looking for dynamic libraries
63980 INFO: Looking for eggs
63980 INFO: Using Python library ~/Softwares/anaconda3/5.0.0/lib/python3.6/site-packages/scipy/linalg/../../../../libpython3.6m.so.1.0
64015 INFO: Warnings written to ~/build/__init__/warn__init__.txt
64298 INFO: Graph cross-reference written to ~/build/__init__/xref-__init__.html
64447 INFO: checking PYZ
64447 INFO: Building PYZ because out00-PYZ.toc is non existent
64447 INFO: Building PYZ (ZlibArchive) ~/build/__init__/out00-PYZ.pyz
67927 INFO: Building PYZ (ZlibArchive) ~/build/__init__/out00-PYZ.pyz completed successfully.
68011 INFO: checking PKG
68011 INFO: Building PKG because out00-PKG.toc is non existent
68011 INFO: Building PKG (CArchive) out00-PKG.pkg
Traceback (most recent call last):
  File "~/Softwares/anaconda3/5.0.0/bin/pyinstaller", line 11, in <module>
    load_entry_point('PyInstaller==3.4.dev0+2611919ba', 'console_scripts', 'pyinstaller')()
  File "~/Softwares/anaconda3/5.0.0/lib/python3.6/site-packages/PyInstaller/__main__.py", line 94, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "~/Softwares/anaconda3/5.0.0/lib/python3.6/site-packages/PyInstaller/__main__.py", line 46, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "~/Softwares/anaconda3/5.0.0/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 791, in main
    build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
  File "~/Softwares/anaconda3/5.0.0/lib/python3.6/site-packages/PyInstaller/building/build_main.py", line 737, in build
    exec(text, spec_namespace)
  File "<string>", line 26, in <module>
  File "~/Softwares/anaconda3/5.0.0/lib/python3.6/site-packages/PyInstaller/building/api.py", line 411, in __init__
    strip_binaries=self.strip, upx_binaries=self.upx,
  File "~/Softwares/anaconda3/5.0.0/lib/python3.6/site-packages/PyInstaller/building/api.py", line 196, in __init__
    self.__postinit__()
  File "~/Softwares/anaconda3/5.0.0/lib/python3.6/site-packages/PyInstaller/building/datastruct.py", line 161, in __postinit__
    self.assemble()
  File "~/Softwares/anaconda3/5.0.0/lib/python3.6/site-packages/PyInstaller/building/api.py", line 273, in assemble
    pylib_name = os.path.basename(bindepend.get_python_library_path())
  File "~/Softwares/anaconda3/5.0.0/lib/python3.6/posixpath.py", line 144, in basename
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType

解决办法:将路径加入到系统变量中

找到对应的路径,比如上述的就是~/Softwares/anaconda3/5.0.0/lib,因此对应的路径添加就是:

LD_LIBRARY_PATH=~/Softwares/anaconda3/5.0.0/lib pyinstaller

打开  .bashrc文件  gedit ~/.bashrc

t添加上述语句,然后直接使能就可以

source ~/.bashrc

 

转载博客:https://blog.csdn.net/LYKXHTP/article/details/82157039

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 14
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 14
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值