26

I am using python 3.4 at win-8. I want to obtain .exe program from python code. I learned that it can be done by cx_Freeze.

In MS-DOS command line, I wrote pip install cx_Freeze to set up cx_Freeze. It is installed but it is not working.

(When I wrote cxfreeze to command line, I get this warning:C:\Users\USER>cxfreeze 'cxfreeze' is not recognized as an internal or external command,operable program or batch file.)

(I also added location of cxfreeze to "PATH" by environment variables)

Any help would be appriciated thanks.

Puggie
  • 3,867
  • 2
  • 35
  • 39
mesel
  • 435
  • 2
  • 5
  • 11
  • did you restart the command prompt after adding `C:\Python34\Scripts` (the default install location) to your PATH? – MattDMo Aug 12 '14 at 18:01
  • @MattDMo: Yes I did it. – mesel Aug 12 '14 at 18:04
  • Try installing `cx_Freeze` for Python 3.4 from [here](http://www.lfd.uci.edu/~gohlke/pythonlibs/#cx_freeze). Also, do you have Python 2.7 installed as well? – MattDMo Aug 12 '14 at 18:06
  • @MattDMo: I did not have python 2.7. I also installed it from your link.it is not working again ): – mesel Aug 12 '14 at 18:21
  • @MattDMo: In a web site, it suggest to edit the C:Python\33\scribts\cxfreeze.bat by notepad. Can similiar thing work ? – mesel Aug 12 '14 at 18:29
  • If you change to the `C:\Python34\Scripts` directory and run `cxfreeze`, what output do you get? – MattDMo Aug 12 '14 at 19:36
  • @MattDMo: I got same output which is in the answer. – mesel Aug 12 '14 at 21:06
  • when installing .whl files, open the .whl as an archive, like you would a zip file, and copy the folders into `[drivename]:/Python[version#]/Lib/` – EgMusic Oct 24 '17 at 17:28

3 Answers3

56

I faced a similar problem (Python 3.4 32-bit, on Windows 7 64-bit). After installation of cx_freeze, three files appeared in c:\Python34\Scripts\:

  • cxfreeze
  • cxfreeze-postinstall
  • cxfreeze-quickstart

These files have no file extensions, but appear to be Python scripts. When you run python.exe cxfreeze-postinstall from the command prompt, two batch files are being created in the Python scripts directory:

  • cxfreeze.bat
  • cxfreeze-quickstart.bat

From that moment on, you should be able to run cx_freeze.

cx_freeze was installed using the provided win32 installer (cx_Freeze-4.3.3.win32-py3.4.exe). Installing it using pip gave exactly the same result.

Puggie
  • 3,867
  • 2
  • 35
  • 39
  • It is unfortunate that these files are not automatically generated during the installation process. Further there don't seem to be any installation instructions in the [documentation](http://cx-freeze.readthedocs.org/en/latest/index.html). – Puggie Sep 19 '14 at 15:02
  • It's only quite recently been practical to pip install cx_Freeze on Windows. There's [an open issue](https://bitbucket.org/anthony_tuininga/cx_freeze/issue/90/cxfreeze-in-windows-is-not-executable) for this. – Thomas K Sep 19 '14 at 22:01
  • It's a problem with either installation method. If the `cxfreeze-postinstall` script automatically would be executed during installation, the problem would solved. This way, batch files are being created, which can be executed by cmd.exe (as opposed to Python script files that have no file name extension). – Puggie Sep 22 '14 at 10:17
  • With wheel installations, we can't execute *anything* during installation. We would have to work out a way to include the .bat files in the wheel. – Thomas K Sep 22 '14 at 15:47
0

go to https://pypi.python.org/pypi?:action=display&name=cx_Freeze&version=4.3.4 and click the one you want to download :)

0

Make sure the Version of Python is correct, if you have more than one version on your computer, just simply type "python" in console to check the version of your python. I just had this problem earlier.

Yue
  • 11