pyinstaller打包问题ImportError: No module named sip 5C
C:\python27\Scripts\pyinstaller\myfile\dist>myfile.exe
Traceback (most recent call last):
  File "pyinstaller\myfile.py", line 2, in <module>
  File "C:\python27\Scripts\pyinstaller\PyInstaller\loader\pyimod03_importers.py", line 684, in load_module
    module = imp.load_module(fullname, fp, filename, ext_tuple)
ImportError: No module named sip
[20104] Failed to execute script myfile

1个回答

你的引用包问题。识别不出sip模块。

# 打包py文件需要
def getExePath():
    sap = '/'
    if sys.argv[0].find(sap) == -1:
        sap = '\\'
    index = sys.argv[0].rfind(sap)
    path = sys.argv[0][:index] + sap
    return path
qq_39148947
qq_39148947 回复poppyque: 解决了么,大佬
大约一年之前 回复
poppyque
poppyque 请问这个代码是哪块的?
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐