• windows下python3.7.2内置venv虚拟环境下pyinstaller错误问题


    起因

    开发一直使用python -m venv .pyenv 方式创建虚拟环境,在利用pyinstaller打包发布应用时,出现错误

    3178 INFO: Warnings written to C:UsersxxxDesktophiPyuildhiwarn-hi.txt
    3203 INFO: Graph cross-reference written to C:UsersxxxDesktophiPyuildhixref-hi.html
    3295 INFO: checking PYZ
    3295 INFO: Building PYZ because PYZ-00.toc is non existent
    3297 INFO: Building PYZ (ZlibArchive) C:UsersxxxDesktophiPyuildhiPYZ-00.pyz
    3587 INFO: Building PYZ (ZlibArchive) C:UsersxxxDesktophiPyuildhiPYZ-00.pyz completed successfully.
    3595 INFO: checking PKG
    3596 INFO: Building PKG because PKG-00.toc is non existent
    3596 INFO: Building PKG (CArchive) PKG-00.pkg
    Traceback (most recent call last):
      (... 略去无关信息 ...)
      File "C:UsersxxxAppDataLocalProgramsPythonPython37lib
    tpath.py", line 183, in split
        p = os.fspath(p)
    TypeError: expected str, bytes or os.PathLike object, not NoneType
    

    排查

    1. 尝试新建空白项目排除与源码状况有关
    2. 尝试不使用venv发现一切正常

    解决

    python3.7版本的venv机制与pyinstaller某些实现有冲突,请采用virtualenv创建虚拟环境。目前并不清楚是否是windows平台特有

  • 相关阅读:
    JAVA网络编程入门
    悲观锁和乐观锁
    原子性---Atomic
    volatile关键字
    leetcode_111. 二叉树的最小深度
    leetcode_110. 平衡二叉树
    leetcode_108. 将有序数组转换为二叉搜索树
    leetcode_107. 二叉树的层次遍历 II
    leetcode_104. 二叉树的最大深度
    leetcode_101. 对称二叉树
  • 原文地址:https://www.cnblogs.com/wuyaSama/p/10783743.html
Copyright © 2020-2023  润新知