Search code examples
scipypyinstaller

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:\Users\username\AppData\Local\Temp\_MEI86402\Include\pyconfig.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?


Solution

  • 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