Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
669 views
in Technique[技术] by (71.8m points)

Pyinstaller --onefile warning pyconfig.h when importing scipy or scipy.signal

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

import scipy

Then run:

python pyinstaller.py --onefile foo.py

When I launch foo.exe I get:

WARNING: file already exists but should not: C:UsersusernameAppDataLocalTemp\_MEI86402Includepyconfig.h

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...