3
votes

I'm trying to make an executable program using python 3.6 and the only software I have found that can do this is cx_Freeze. However I am having the problem every time I run "python setup.py build" in CMD I get an error when trying to open my application.

Missing required dependencies, import error: Missing required dependencies ['numpy' ] when I try and freeze an executable.

Here is my setup.py

import cx_Freeze
from cx_Freeze import setup
from cx_Freeze import Executable
import sys
import matplotlib
import pandas

import os

import os.path
PYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))
os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')
os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')

base = None

if sys.platform == 'win32':
    base = "Win32GUI"

executables = [cx_Freeze.Executable("EXE.py",icon = 'RomacLogo.ico', base=base)]

build_exe_options = {"packages": ["numpy"]}

cx_Freeze.setup(
    name = "DAGM",
    options = {"build.exe":{"packages":["tkinter", "matplotlib",'numpy', "numpy.lib.format", "pandas", "glob"], "include_files":["RomacLogo.ico"]}},
    version = "0.01",
    description = "Data Transfer and Analysis Application",
    executables = executables
)

Are there any other freeze programs I could use to make an executable besides cx_freeze??

Any help would be much appreciated!

3

3 Answers

1
votes

Find the numpy submodule named _methods in Lib/site-packages/numpy/core/ copy and paste it to build/exe.win64-3.6/numpy/core/.

0
votes

RESOLVED-KINDA... I created a virtual environment in python 3.5.0 and was able to run py-installer for python 3.5. Couldn't get cx_Freeze to work the numpy dependencies still kept being a problem.

0
votes

Here's my setup.py which I can confirm works for CX_freeze for an app with tkinter, pandas & numpy. Numpy definitely seems to be a tough one to crack.

import sys
from cx_Freeze import setup, Executable
import os

build_exe_options = {"include_files": ["tcl86t.dll", "tk86t.dll"], "packages": ["numpy"]} 


base = None  
if sys.platform == "win32":  
    base = "Win32GUI"  


os.environ['TCL_LIBRARY'] = r'C:\Users\lyu\AppData\Local\Programs\Python\Python36\tcl\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\Users\lyu\AppData\Local\Programs\Python\Python36\tcl\tk8.6'

setup(
      name = "Fun Fun Fun",
      version = "1.0",
      description = "Fun Fun Fun",
      options = {"build_exe": build_exe_options},
      executables = [Executable("funfunfunfunfun.py", base = base)],
      package_dir={'': ''},
      )