PyInstaller with Pandas creates over 500 MB exe

后端 未结 6 1214
栀梦
栀梦 2020-12-08 05:39

I try to create an exe file using PyInstaller 3.2.1, for test purpose I tried to make an exe for following code:

import pandas as pd
print(\'hello world\')
<         


        
6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-08 06:05

    A simple solution while working with Anaconda:

    -Make a new environment inside Anaconda Navigator. (The new environment is free from the large amounts of packages that are causing the problem.)

    -Open a terminal and use pipinstall to include the packages you need. ( Make sure it is in the new environment)

    -Run pyinstaller.

    I reduced my .exe from 300 MB to 30 MB.

提交回复
热议问题