V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
alittletrain
V2EX  ›  Python

求助 pyinstaller 打包的 exe 在 xp 下报错

  •  
  •   alittletrain · 2016-08-04 09:58:14 +08:00 · 7670 次点击
    这是一个创建于 2827 天前的主题,其中的信息可能已经有所发展或是发生改变。

    模块如下:

    
    from tkinter import *
    
    import tkinter
    import datetime
    import time
    import win32clipboard
    import tkinter.messagebox
    

    在 xp 下 提示 无法定位程序输入点 Getfinalpathnamebyhandlew 于动态链接库 kernel32.dll

    13 条回复    2019-08-14 10:48:44 +08:00
    jeremaihloo
        1
    jeremaihloo  
       2016-08-04 10:26:03 +08:00
    这意思是说 XP 的 kernel32.dll 没有这个函数之类的?不懂,只知道 kernel32.dll 是 win32 的核心 dll ,帮顶
    iVanilla
        2
    iVanilla  
       2016-08-04 10:37:44 +08:00
    用 Google 搜索 Getfinalpathnamebyhandlew 即可。
    https://msdn.microsoft.com/en-us/library/windows/desktop/aa364962%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396
    https://mail.python.org/pipermail/python-dev/2015-July/140823.html

    Minimum supported client
    Windows Vista [desktop apps only]

    所以说 XP 是不支持这个函数的,也就运行不了。
    alittletrain
        3
    alittletrain  
    OP
       2016-08-04 10:42:55 +08:00
    @iVanilla 不支持哪个函数??在我的源码里吗?
    iVanilla
        4
    iVanilla  
       2016-08-04 10:45:38 +08:00
    @alittletrain 就是 Getfinalpathnamebyhandlew 啊,这个是 Vista 加入的 API 。
    alittletrain
        5
    alittletrain  
    OP
       2016-08-04 11:10:23 +08:00
    @iVanilla 那我的源代码怎么修改呢?
    devzero
        6
    devzero  
       2016-08-04 11:23:38 +08:00 via Android
    同遇到这个情况,那么如何用 py2exe 打包才能在 xp 下运行?
    alittletrain
        7
    alittletrain  
    OP
       2016-08-04 11:34:53 +08:00
    @devzero 我猜可以需要用 py2
    iVanilla
        8
    iVanilla  
       2016-08-04 12:20:23 +08:00
    @alittletrain @devzero 你们用的最新版? Python3.5 不支持 XP ,需要 VIsta 以上系统。
    alittletrain
        9
    alittletrain  
    OP
       2016-08-04 13:08:41 +08:00
    @iVanilla 我在 xp 下 用 2.7 打包后 提示 failed to execute script xxx
    dowern
        10
    dowern  
       2016-08-04 14:58:44 +08:00
    前天遇上同样的问题, 最好的办法是开 XP 虚拟机, 安装 xp 对应 32 位或 64 位 python 和依赖包(和开发环境一致), 然后运行正常再打包, 基本就不会再出现这问题.

    需要 Python3.4, 3.5 不支持 XP
    alittletrain
        11
    alittletrain  
    OP
       2016-08-04 16:20:04 +08:00
    @dowern 我用 xp python 2.7 32 位 但是打包后 提示 failed to execute script xxx
    shanpower
        12
    shanpower  
       2018-04-08 23:21:27 +08:00 via Android
    你解决了没
    @alittletrain
    Manito
        13
    Manito  
       2019-08-14 10:48:44 +08:00
    单位办公电脑几乎都是 xp 系统,因为资料太多也不好升级,自己开发的程序无法运行,也是提示 无法定位程序输入点 Getfinalpathnamebyhandlew 于动态链接库 kernel32.dll ,求除了升级操作系统之外的解决办法。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   906 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 22:58 · PVG 06:58 · LAX 15:58 · JFK 18:58
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.