导入 scipy 或 scipy.signal 时 Pyinstaller --onefile 警告 pyconfig.h [英] Pyinstaller --onefile warning pyconfig.h when importing scipy or scipy.signal

查看:55
本文介绍了导入 scipy 或 scipy.signal 时 Pyinstaller --onefile 警告 pyconfig.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这很容易重新创建.如果我的脚本 foo.py 是:

This is very simple to recreate. If my script foo.py is:

import scipy

然后运行:

python pyinstaller.py --onefile foo.py

当我启动 foo.exe 时,我得到:

When I launch foo.exe I get:

WARNING: file already exists but should not: C:\Users\username\AppData\Local\Temp\_MEI86402\Include\pyconfig.h

我已经测试了几个版本,但我确认的最新版本是在 Win7 上运行的 2.1dev-e958e02、Python 2.7.5(32 位)、Scipy 版本 0.12.0

I've tested a few versions but the latest I've confirmed is 2.1dev-e958e02 running on Win7, Python 2.7.5 (32 bit), Scipy version 0.12.0

我已经向 Pyinstaller 人员提交了一张票,但还没有听到任何消息.任何线索如何进一步调试?

I've submitted a ticket with the Pyinstaller folks but haven't heard anything yet. Any clues how to debug this further?

推荐答案

您可以通过在 a=Analysis 之后添加这些行来破解规范文件以删除第二个实例:

You can hack the spec file to remove the second instance by adding these lines after a=Analysis:

for d in a.datas:
    if 'pyconfig' in d[0]: 
        a.datas.remove(d)
        break

这篇关于导入 scipy 或 scipy.signal 时 Pyinstaller --onefile 警告 pyconfig.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆