Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 605
Jonno Avatar asked Sep 27 '13 15:09

Jonno


2 Answers

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 
like image 65
Ilya Tolchinsky Avatar answered Jan 14 '23 15:01

Ilya Tolchinsky


The answer by wtobia@ worked for me. See https://github.com/pyinstaller/pyinstaller/issues/783

  1. Go to C:\Python27\Lib\site-packages\PyInstaller\build.py
  2. Find the def append(self, tpl): function.
  3. Change if tpl[2] == "BINARY": to if tpl[2] in ["BINARY", "DATA"]:
like image 20
frmdstryr Avatar answered Jan 14 '23 16:01

frmdstryr