cx_freeze fails to create exe with pandas library

前端 未结 2 712
别那么骄傲
别那么骄傲 2020-12-19 18:31

Having problems creating exe using cx_freeze with a Pandas library. I have seen lots of others having issues with numPy but I was able to successfully bring in numPy. My big

2条回答
  •  难免孤独
    2020-12-19 18:47

    The following should help you get over this problem (and may lead you to the next one of missing dependencies ;) )

    Checking the code for freeze.py, there is a case that is not checked, so I made the following changes to freezer.py:

    line 600, from

        try:
            if module.parent is not None:
                path = os.pathsep.join([origPath] + module.parent.path)
                os.environ["PATH"] = path
            self._CopyFile(module.file, target, copyDependentFiles)
        finally:
            os.environ["PATH"] = origPath
    

    to:

        try:
            if module.parent is not None:
                if module.parent.path is not None:
                    path = os.pathsep.join([origPath] + module.parent.path)
                    os.environ["PATH"] = path
                    self._CopyFile(module.file, target, copyDependentFiles)
                else:
                    path = os.pathsep.join([origPath, os.path.dirname(module.parent.file)])
                    os.environ["PATH"] = path
                    print '========================================================'
        finally:
            os.environ["PATH"] = origPath
    

提交回复
热议问题