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

后端 未结 5 1147
梦毁少年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条回答
  •  隐瞒了意图╮
    2020-12-01 06:14

    I realized that the problem is that Windows is case-insensitive and these 2 statements are source directories are "duplicates: include\pyconfig.h Include\pyconfig.h

    My solution is to manually tweak the .spec file with after the a=Analysis() call:

    import platform
    if platform.system().find("Windows")>= 0:
        a.datas = [i for i in a.datas if i[0].find('Include') < 0]
    

    This worked in my 2 tests.

    A more flexible solution would be to check ALL items for case-insensitive collisions.

提交回复
热议问题