Creating Executable File Of My Python Script
I am trying to create an executable file out of my python script. System config : python --version : Python 2.7.15 :: Anaconda, Inc. conda : 4.3.
Solution 1:
You should be able to run the following commands without errors in a Python console:
import numpy print numpy.__version__ import pandas print pandas.__version__
If this does not work, you first need to (re-)install
numpy
andpandas
in this order.In order to freeze a script depending on
pandas
(and thus onnumpy
) withcx_Freeze
, you need to explicitly addnumpy
to thepackages
list of thebuild_exe
options. Try with the following modification of your setup script:from cx_Freeze import setup, Executableoptions= {'build_exe': {'packages': ['numpy']}} setup(name = "Expiry" , version = "1.0" , description = "" , options = options, executables = [Executable("Expiry.py")])
Solution 2:
@jpeg as pointed out, here is my solution that worked after your recommendation.
from cx_Freeze import setup, Executableoptions= {'build_exe': {'packages': ['numpy'], 'include_files':['X:\Anaconda\Lib\site-packages\mkl_intel_thread.dll']} }
setup(name = "Expiry" ,
version = "1.0" ,
description = "" ,
options = options,
executables = [Executable("Expiry.py")])
Post a Comment for "Creating Executable File Of My Python Script"