Python Forum
cx_Freeze doesn't seem to work
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cx_Freeze doesn't seem to work
#5
Testet with 3.5 and 3.6 and it work.
I use wheel from gohlke.

The default path is horrible,i would reinstall and choose a path like C:\python35
Make sure that add python 3.5 to PATH and pip is marked on.
Restart pc.

Files:
#hello_cx.py
from datetime import datetime

print('Hello from cx_Freeze')
print('The current date is {}'.
     format(datetime.today().strftime('%B %d, %Y %H:%M:%S')))
#make_exe.py
from cx_Freeze import setup,Executable
import sys

# Replaces commandline arg 'build'
#sys.argv.append("build")

# If need to include/exclude module/packages
includes = []
excludes = []
packages = []

# Console or Win32GUI
base = None
if sys.platform == "win32":
    base = 'Console'
    #base = 'Win32GUI'

# Name of file to make ".exe" of
filename = "hello_cx.py"
setup(
    name = 'Myapp',
    version = '0.1',
    description = 'Cx test',
    options = {'build_exe': {'excludes':excludes,'packages':packages,'includes':includes}},
    executables = [Executable(filename, base=base, icon = None)])

# From command line
#python make_exe.py build
I do run it from virtual environment(it's now build in 3.5).
Here is the whole process(shell is cmder).

# make virtual environment 
C:\Python35
λ python -m venv cx_test

C:\Python35
λ cd cx_test/scripts

C:\Python35\cx_test\Scripts
λ C:\Python35\cx_test\Scripts\activate.bat

(cx_test) C:\Python35\cx_test\Scripts
λ pip install cx_Freeze-5.0-cp35-cp35m-win32.whl
Processing c:\python35\cx_test\scripts\cx_freeze-5.0-cp35-cp35m-win32.whl
Installing collected packages: cx-Freeze
Successfully installed cx-Freeze-5.0

(cx_test) C:\Python35\cx_test\Scripts
λ python make_exe.py build
# A lot of files

(cx_test) C:\Python35\cx_test\Scripts
λ cd build\exe.win32-3.5

# Test exe
(cx_test) C:\Python35\cx_test\Scripts\build\exe.win32-3.5
λ hello_cx.exe
Hello from cx_Freeze
The current date is January 03, 2017 00:44:34
Quote:I have previously had no luck with py2exe or pyinstaller, which evidently work only with python 2.
pyinstaller was the first one that worked for 3.5.
py2exe work up to 3.4.
Reply


Messages In This Thread
cx_Freeze doesn't seem to work - by owenwalker65 - Jan-02-2017, 05:49 PM
RE: cx_Freeze doesn't seem to work - by metulburr - Jan-02-2017, 06:03 PM
RE: cx_Freeze doesn't seem to work - by metulburr - Jan-02-2017, 08:48 PM
RE: cx_Freeze doesn't seem to work - by snippsat - Jan-03-2017, 12:07 AM
RE: cx_Freeze doesn't seem to work - by issac_n - Dec-06-2017, 10:09 AM
RE: cx_Freeze doesn't seem to work - by snippsat - Dec-06-2017, 05:49 PM
RE: cx_Freeze doesn't seem to work - by issac_n - Dec-07-2017, 02:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Convolution "same" in Python doesn't work as Matlab claw91 4 3,860 Oct-01-2020, 08:59 AM
Last Post: claw91
  Numpy doesn't work in Spyder 4.1.3 player1681 1 2,188 Jun-02-2020, 11:26 AM
Last Post: jefsummers
  scipy interp2d doesn't work player1681 4 4,574 Feb-05-2020, 09:50 AM
Last Post: player1681
  cx_freeze exe does nothing taigi100 0 2,707 Jul-08-2018, 02:11 PM
Last Post: taigi100
  cx_freeze exe error issac_n 0 3,346 Dec-07-2017, 10:08 AM
Last Post: issac_n
  cx_freeze setup.py TCL_LIBRARY error issac_n 0 3,805 Dec-05-2017, 10:40 AM
Last Post: issac_n
  Matplotlib Doesn't Work Ian12290 6 13,351 Feb-28-2017, 06:18 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020