1
votes

Using anaconda 3.5/jupyter/spyder. I have installed Py2exe 0.9.2.2 which supports Python 3.3 and above. I am interested in creating an executable file from python script. The code py -3.4 -m py2exe.build_exe myscript.py does not work in jupyter notebook and anaconda prompt. i see python.exe file located in the folder:

C:\Users\me\AppData\Local\Continuum\Anaconda2

Thanks in advance for the help.

1
"does not work" - what's the error message? - Jeronimo
@Jeronimo thanks. Current working directory is C:\Users\me\AnacondaProjects\py2exe In [8]: print('hello world!') hello world! In [9]: py -3.4 -m py2exe.build_exe hello.py error message File "<ipython-input-9-a361fa544b02>", line 1 py -3.4 -m py2exe.build_exe hello.py ^ SyntaxError: invalid syntax 'In [10]: build_exe hello.py' error message File "<ipython-input-10-e4bdea309ba3>", line 1 build_exe hello.py ^ SyntaxError: invalid syntax` - anatta
Wherever you took that from, but it looks like a command line. Or maybe there's an IPython magic command "%py" that I dont know of. Anyways, try opening a command line in your Anaconda folder, and do python.exe -m py2exe.build_exe C:/full/path/to/myscript.py. - Jeronimo

1 Answers

0
votes

@Jeronimo answer worked right.

Wherever you took that from, but it looks like a command line. Or maybe there's an IPython magic command "%py" that I dont know of. Anyways, try opening a command line in your Anaconda folder, and do python.exe -m py2exe.build_exe C:/full/path/to/myscript.py.