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

后端 未结 5 1152
梦毁少年i
梦毁少年i 2020-12-01 05:23

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

import scipy

Then run:

python pyinstaller.py --onefile foo.py
         


        
5条回答
  •  旧时难觅i
    2020-12-01 06:22

    Expanding upon Ilya's solution, I think this is a little bit more robust solution to modifying the spec file (again place after the a=Analysis... statement).

    a.datas = list({tuple(map(str.upper, t)) for t in a.datas})
    

    I only tested this on a small test program (one with a single import and print statement), but it seems to work. a.datas is a list of tuples of strings which contain the pyconfig.h paths. I convert them all to lowercase and then dedup. I actually found that converting all of them all to lowercase was sufficient to get it to work, which suggests to me that pyinstaller does case-sensitive deduping when it should be case-insensitive on Windows. However, I did the deduping myself for good measure.

提交回复
热议问题