Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 cx_freeze exe does not work?
#1
Hi All

I have a very simple python file that I need to run of an exe. The program works perfectly through python console but when running the exe it does not produce an html file as it should.
Not sure if there is some dependencies needed to be included or what?
Please Help!

Program:
import folium
map = folium.Map(location=[-12.0742614,34.9538616],zoom_start=15)
map.add_child(folium.Marker( location=[-12.0742614,34.9538616], popup='TestLocation',icon=folium.Icon(color='orange')))
map.save("Map.html") 
cx_freeze setup file:
from cx_Freeze import setup, Executable
setup(name = "map1" ,
      version = "0.1" ,
      description = "" ,
       options = {'build_exe': {'excludes':excludes,'packages':packages,'includes':includes}},
      executables = [Executable("map1.py")])
Quote
#2
if using windows, try py2exe see: https://python-forum.io/Thread-Intermedi...ith-Py2exe
if Linux, pyinstaller
and if OS X, pyapp.
KipCarter likes this post
Quote
#3
(May-19-2018, 12:39 AM)Skycoder Wrote: cx_freeze setup file:
from cx_Freeze import setup, Executable
setup(name = "map1" ,
      version = "0.1" ,
      description = "" ,
       options = {'build_exe': {'excludes':excludes,'packages':packages,'includes':includes}},
      executables = [Executable("map1.py")])

Your setup file is fairly abbreviated from what you could be doing with it.

Try including the following line before your setup (name = "map1" , line.

includes = ["folium"]

Anytime I'm putting an include in my py file I include the item included in the includes = line.

Hope that does the trick for you!
Kip...
Quote
#4
(May-19-2018, 02:06 AM)Larz60+ Wrote: if using windows, try py2exe see: https://python-forum.io/Thread-Intermedi...ith-Py2exe
if Linux, pyinstaller
and if OS X, pyapp.

I'm on Python 3.6 and if there is a wheel file I would definitely give it a shot! I haven't seen one as of yet.

Kip...

Larz60+, I got px2exe installed now I'm trying to figure out how to build my setup file to build my executable file. I would prefer to have this be a single file.

Here is the Python code:
import os
import sys
import subprocess
from socket import *

subprocess.call("cls", shell=True)

theargis = ''

if len(sys.argv) > 1:
    theargis +=str(sys.argv[1])

if theargis > '':
    host = theargis
    print ("Using Client Address of: " + theargis)
else:
    host = "53.68.240.47"
    print ("Using Default Address!")

port = 13000
buf = 1024
addr = (host, port)

UDPSock = socket(AF_INET, SOCK_DGRAM)
UDPSock.bind(addr)

print ("Waiting to receive messages...")

while True:
    (data, addr) = UDPSock.recvfrom(buf)
    print ("Production number: " + data.decode("utf-8"))
    if data.decode("utf-8").upper() == "EXIT":
        break

UDPSock.close()
os._exit(0)
But the only example I can find is the tutorial for py2exe which is:
from distutils.core import setup
   import py2exe
   
   setup(console=['hello.py'])
To which I swapped out the 'hello.py' for Receiver.py.

This of course didn't work at all.

Any good references, to help me build the setup file I'd need to convert this py to a single file exe.

Thanks,
Kip...
Quote
#5
Apology!

I'm pulling my hair out over this one and in the process I thought that this was thread that I started. IT WAS NOT! I didn't have any intent to highjack someone else's thread. I thought I was responding to a comment to a thread I had started.

I still would like some insight on the setup file for py2exe but I apologize for the highjack.

Wall Wall Wall
Doh Doh Doh

Kip...
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  cx_freeze frozen executive introduces WinError 10049 KipCarter 3 385 Jan-14-2020, 02:34 PM
Last Post: KipCarter
  Python 3.6 Alternatives to Cx_Freeze KipCarter 5 576 Jan-14-2020, 11:51 AM
Last Post: KipCarter
  How to get cx_Freeze to make folders mad_accountant 0 331 Nov-24-2019, 02:22 PM
Last Post: mad_accountant
  cx_freeze setup.py error: No module __SNMP-FRAMEWORK-MIB nacho 8 3,809 Jul-26-2019, 09:33 PM
Last Post: njmatt415
  Error in build using cx_freeze with psychopy based animation olivyac 0 1,226 Sep-19-2017, 07:55 PM
Last Post: olivyac

Forum Jump:


Users browsing this thread: 1 Guest(s)