Re: [cx-freeze-users] Missing multiprocessing - Python 3.4
Brought to you by:
atuining
From: Dean C. <dea...@gm...> - 2014-04-10 14:23:30
|
With the long includes I get the following error: Traceback (most recent call last): > File "/Users/dean/app/setup.py", line 31, in <module> > executables = [Executable(main_python_file, base = > base,icon="./resources/logo.icns")]) > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/cx_Freeze/dist.py", > line 365, in setup > distutils.core.setup(**attrs) > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/core.py", > line 149, in setup > dist.run_commands() > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", > line 955, in run_commands > self.run_command(cmd) > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", > line 974, in run_command > cmd_obj.run() > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/cx_Freeze/macdist.py", > line 200, in run > self.run_command('build') > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/cmd.py", > line 313, in run_command > self.distribution.run_command(command) > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", > line 974, in run_command > cmd_obj.run() > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/command/build.py", > line 126, in run > self.run_command(cmd_name) > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/cmd.py", > line 313, in run_command > self.distribution.run_command(command) > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/distutils/dist.py", > line 974, in run_command > cmd_obj.run() > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/cx_Freeze/dist.py", > line 235, in run > freezer.Freeze() > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/cx_Freeze/freezer.py", > line 575, in Freeze > self.finder = self._GetModuleFinder() > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/cx_Freeze/freezer.py", > line 328, in _GetModuleFinder > finder.IncludeModule(name) > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/cx_Freeze/finder.py", > line 571, in IncludeModule > namespace = namespace) > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/cx_Freeze/finder.py", > line 288, in _ImportModule > raise ImportError("No module named %r" % name) > ImportError: No module named 'multiprocessing.Queue' Im really quite stuck with this, it was all working fine in python 2.7 however because of the multiprocessing bug for OS X i've had to upgrade. Kind Regards, Dean Chester On 10 April 2014 15:15, Owen Kelly <ok...@bi...> wrote: > Queue is noted as missing in your attachment viz: > > > > Missing modules: > > [...] > > ? multiprocessing.AuthenticationError imported from > multiprocessing.connection > > ? multiprocessing.BufferTooShort imported from multiprocessing.connection > > ? multiprocessing.Queue imported from app.Controller, app.Parser > > ? multiprocessing.TimeoutError imported from multiprocessing.pool > > ? multiprocessing.cpu_count imported from multiprocessing.pool > > ? multiprocessing.current_process imported from > multiprocessing.popen_spawn_posix, multiprocessing.semaphore_tracker > > ? multiprocessing.get_context imported from multiprocessing.managers, > multiprocessing.pool, multiprocessing.sharedctypes > > ? multiprocessing.get_start_method imported from multiprocessing.spawn > > ? multiprocessing.set_start_method imported from multiprocessing.spawn > > > > > > So try > > includes = ["atexit","re", "tkinter", "multiprocessing", > "multiprocessing.Queue"] > > > > also I noticed in the multiproc docs some talk of set_start_method, and it > is also missing, so if you didn't call it maybe you should? > > And if you did, maybe cx would pick that up and include it (grasping at > straws here) > > Or you could just add it to your includes anyway. > > Generally no harm in putting a whole bunch of redundant stuff in your > includes; I think it just helps cx find everything and backstops whatever > search heuristics they use for gathering stuff. > > OK it may make your frozen output a bit bigger, but functionality trumps > size, you can trim it back later. > > > > includes = ["atexit","re", "tkinter", "multiprocessing", > "multiprocessing.Queue", "multiprocessing.TimeoutError", > "multiprocessing.AuthenticationError", ...] > > > > .02, > > Owen > > > > *From:* Dean Chester [mailto:dea...@gm...] > *Sent:* April-10-14 9:58 AM > *To:* primary discussion list for use and development of cx_Freeze; > ok...@bi... > > *Subject:* Re: [cx-freeze-users] Missing multiprocessing - Python 3.4 > > > > Still not working :(. > > > > I've attached the complete output from cx-freeze. And when I run the > result I get this output: > > > > Last login: Thu Apr 10 14:50:06 on ttys009 > > /Users/dean/app/build/exe.macosx-10.6-intel-3.4/App ; exit; > > Deans-MacBook-Pro:~ dean$ > /Users/dean/app/build/exe.macosx-10.6-intel-3.4/App ; exit; > > Traceback (most recent call last): > > File > "/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/cx_Freeze/initscripts/Console3.py", > line 27, in <module> > > exec(code, m.__dict__) > > File "./app/App.py", line 14, in <module> > > File "/Users/dean/app/app/Controller.py", line 35, in __init__ > > self.queue = Queue() > > > > Kind Regards, > > > > Dean Chester > > > > > > On 10 April 2014 14:40, Owen Kelly <ok...@bi...> wrote: > > Another direction is > > includes = ["atexit","re", "tkinter", "multiprocessing", > "multiprocessing.spawn"] > if the latter is a valid import. > > > > > > *From:* Dean Chester [mailto:dea...@gm...] > *Sent:* April-10-14 9:37 AM > *To:* ok...@bi...; primary discussion list for use and development > of cx_Freeze > *Subject:* Re: [cx-freeze-users] Missing multiprocessing - Python 3.4 > > > > Hi Owen, > > > > I'm trying to freeze on my development platform where the application is > working. My development machine has python 3.4 and all other dependancies > installed. > > > > Kind Regards, > > > > Dean Chester > > > > On 10 April 2014 14:31, Owen Kelly <ok...@bi...> wrote: > > Hi Dean, > > Your situation (possibly) echoes a multiplatform cx_freeze issue I had with > Bluetooth. > Basically, freeze can only freeze code that is present on the machine where > freezing is done. So when I froze on a machine with Microsoft Bluetooth > driver (MSBT) and without widcomm driver, and then installed on a machine > with only widcomm driver, there were missing pieces. In that case my > solution was to do my final freeze for each release on a machine that had > both Bluetooth drivers. > > In relation to your problem, I see that > https://docs.python.org/3/library/multiprocessing.html > "17.2.1.2. Contexts and start methods: Depending on the platform, > multiprocessing supports three ways to start a process." > So are you freezing on a machine where multiprocessing works without > multiprocessing.spawn (and maybe multiprocessing.spawn code is absent), and > unfreezing on a machine where multiprocessing uses multiprocessing.spawn? > > Regards, > > Owen > > From: Dean Chester [mailto:dea...@gm...] > Sent: April-10-14 5:49 AM > To: primary discussion list for use and development of cx_Freeze > Subject: [cx-freeze-users] Missing multiprocessing - Python 3.4 > > > Hi, > > I'm freezing a script on OS X and I am getting the error: > Missing Modules: > ? multiprocessing.get_start_method imported from multiprocessing.spawn > When Running the app i get the following error: > > NameError: name 'multiprocessing' is not defined > > I am using python 3.4 on OS X. > > My setup.py looks like: > application_title = "Application" #what you want to application to be > called > main_python_file = "./app/App.py" #the name of the python file you use to > run the program > import sys > from cx_Freeze import setup, Executable > base = None > if sys.platform == "win32": > base = "Win32GUI" > includes = ["atexit","re", "tkinter", "multiprocessing"] > setup( > name = application_title, > version = "0.1", > description = "App Description", > options = {"build_exe" :{"includes" : includes } }, > executables = [Executable(main_python_file, base = base, > icon="./resources/logo.icns")]) > > Kind Regards, > > Dean Chester > > > ------------------------------------------------------------------------------ > Put Bad Developers to Shame > Dominate Development with Jenkins Continuous Integration > Continuously Automate Build, Test & Deployment > Start a new project now. Try Jenkins in the cloud. > http://p.sf.net/sfu/13600_Cloudbees > _______________________________________________ > cx-freeze-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-freeze-users > > > > > |