Thread: [cx-freeze-users] Unable to include multiple modules
Brought to you by:
atuining
From: Smith, J. <js...@me...> - 2009-04-13 19:38:06
|
Using cx_Freeze 4.0.1 with Python 2.5.4 on Windows XP. I have tried cxfreeze --include-modules=encodings.ascii,encodings.cp437 script.py with the same error as an earlier poster: Usage: cxfreeze [options] [SCRIPT] Freeze a Python script and all of its referenced modules to a base executable which can then be distributed without requiring a Python installation. cxfreeze: error: only one script can be specified As you can see, there are no spaces in my command line. I also tried doing this with a setup script: from cx_Freeze import setup, Executable setup(executables = [Executable('script.py', includes=['encodings.ascii', 'encodings.cp437'])]) using python setup.py build but the listing does not show either of them included: Name File ---- ---- m BUILD_CONSTANTS m UserDict C:\Python25\lib\UserDict.py m __builtin__ m _codecs m _sre m _types m array m codecs C:\Python25\lib\codecs.py m copy C:\Python25\lib\copy.py m copy_reg C:\Python25\lib\copy_reg.py m cx_Freeze__init__ C:\Python25\lib\site-packages\cx_Freeze\initscripts\ Console.py P encodings C:\Python25\lib\encodings\__init__.py m encodings.aliases C:\Python25\lib\encodings\aliases.py m errno m imp m itertools m linecache C:\Python25\lib\linecache.py m nt m ntpath C:\Python25\lib\ntpath.py m os C:\Python25\lib\os.py m popen2 C:\Python25\lib\popen2.py m posixpath C:\Python25\lib\posixpath.py m re C:\Python25\lib\re.py m repr C:\Python25\lib\repr.py m script__main__ script.py m sre_compile C:\Python25\lib\sre_compile.py m sre_constants C:\Python25\lib\sre_constants.py m sre_parse C:\Python25\lib\sre_parse.py m stat C:\Python25\lib\stat.py m string C:\Python25\lib\string.py m strop m sys m types C:\Python25\lib\types.py m warnings C:\Python25\lib\warnings.py m zipimport m zlib Finally I tried a simpler setup script: from cx_Freeze import setup, Executable setup(executables = [Executable('script.py')]) and the command line python setup.py build_exe --includes=encodings.ascii,encodings.cp437 which errors out with running build_exe Traceback (most recent call last): File "setup.py", line 4, in <module> setup(executables = [Executable('script.py')]) File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 278, in setup distutils.core.setup(**attrs) File "C:\Python25\Lib\distutils\core.py", line 151, in setup dist.run_commands() File "C:\Python25\Lib\distutils\dist.py", line 974, in run_commands self.run_command(cmd) File "C:\Python25\Lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 165, in run freezer.Freeze() File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 403, in Freeze self.finder = self._GetModuleFinder() File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 251, in _GetMo duleFinder finder.IncludeModule(name) File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 397, in Include Module module = self._ImportModule(name, deferredImports) File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 201, in _Import Module raise ImportError, "No module named %s" % name ImportError: No module named encodings.ascii,encodings.cp437 Is it actually possible to import two encodings this way? What have people done successfully. Maybe something is going wrong in the install of cx_Freeze itself to generate these problems. Jeffery G. Smith MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690 Parkway Drive | Mason, OH 45040 USA | phone +1.513.204.2601 | fax +1.513.229.5505 | mobile +1.513.335.1517 | jsmith@MedPlus.com | www.MedPlus.com <http://www.medplus.com/> Please think about resource conservation before you print this message Confidentiality Notice: The information contained in this electronic transmission is confidential and may be legally privileged. It is intended only for the addressee(s) named above. If you are not an intended recipient, be aware that any disclosure, copying, distribution or use of the information contained in this transmission is prohibited and may be unlawful. If you have received this transmission in error, please notify us by telephone (513) 229-5500 or by email (postmaster@MedPlus.com). After replying, please erase it from your computer system. |
From: Alexandre A. <am...@es...> - 2009-04-13 19:55:32
|
Hi there, I've take a look in my cx_freeze scripts and found out that I call "setup" as following in order to make it work: setup( executables = [ (...) ], options = { 'build_exe' : { 'includes' : [(...)], 'excludes' : [(...)], } } ) Note that I place the "includes" and "excludes" directives inside "build_exe" dictionary key of the options dictionary. The "options" dictionary is at the same level as the executables, inside the setup call. I hope this is what you're looking for. Best Regards Alexandre Motta de Andrade Configuration Manager www.esss.com.br On Mon, Apr 13, 2009 at 16:38, Smith, Jeff <js...@me...> wrote: > Using cx_Freeze 4.0.1 with Python 2.5.4 on Windows XP. > > I have tried > cxfreeze --include-modules=encodings.ascii,encodings.cp437 > script.py > with the same error as an earlier poster: > Usage: cxfreeze [options] [SCRIPT] > > Freeze a Python script and all of its referenced modules to a base > executable which can then be distributed without requiring a Python > installation. > > cxfreeze: error: only one script can be specified > > As you can see, there are no spaces in my command line. I also tried doing > this with a setup script: > > from cx_Freeze import setup, Executable > setup(executables = [Executable('script.py', > includes=['encodings.ascii', 'encodings.cp437'])]) > using > > python setup.py build > > but the listing does not show either of them included: > Name File > ---- ---- > m BUILD_CONSTANTS > m UserDict C:\Python25\lib\UserDict.py > m __builtin__ > m _codecs > m _sre > m _types > m array > m codecs C:\Python25\lib\codecs.py > m copy C:\Python25\lib\copy.py > m copy_reg C:\Python25\lib\copy_reg.py > m cx_Freeze__init__ > C:\Python25\lib\site-packages\cx_Freeze\initscripts\ > Console.py > P encodings C:\Python25\lib\encodings\__init__.py > m encodings.aliases C:\Python25\lib\encodings\aliases.py > m errno > m imp > m itertools > m linecache C:\Python25\lib\linecache.py > m nt > m ntpath C:\Python25\lib\ntpath.py > m os C:\Python25\lib\os.py > m popen2 C:\Python25\lib\popen2.py > m posixpath C:\Python25\lib\posixpath.py > m re C:\Python25\lib\re.py > m repr C:\Python25\lib\repr.py > m script__main__ script.py > m sre_compile C:\Python25\lib\sre_compile.py > m sre_constants C:\Python25\lib\sre_constants.py > m sre_parse C:\Python25\lib\sre_parse.py > m stat C:\Python25\lib\stat.py > m string C:\Python25\lib\string.py > m strop > m sys > m types C:\Python25\lib\types.py > m warnings C:\Python25\lib\warnings.py > m zipimport > m zlib > > Finally I tried a simpler setup script: > from cx_Freeze import setup, Executable > setup(executables = [Executable('script.py')]) > and the command line > python setup.py build_exe > --includes=encodings.ascii,encodings.cp437 > which errors out with > running build_exe > Traceback (most recent call last): > File "setup.py", line 4, in <module> > setup(executables = [Executable('script.py')]) > File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 278, in > setup > distutils.core.setup(**attrs) > File "C:\Python25\Lib\distutils\core.py", line 151, in setup > dist.run_commands() > File "C:\Python25\Lib\distutils\dist.py", line 974, in run_commands > self.run_command(cmd) > File "C:\Python25\Lib\distutils\dist.py", line 994, in run_command > cmd_obj.run() > File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 165, in run > freezer.Freeze() > File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 403, in > Freeze > > self.finder = self._GetModuleFinder() > File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 251, in > _GetMo > duleFinder > finder.IncludeModule(name) > File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 397, in > Include > Module > module = self._ImportModule(name, deferredImports) > File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 201, in > _Import > Module > raise ImportError, "No module named %s" % name > ImportError: No module named encodings.ascii,encodings.cp437 > > > Is it actually possible to import two encodings this way? What have people > done successfully. Maybe something is going wrong in the install of > cx_Freeze itself to generate these problems. > > > Jeffery G. Smith > MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690 > Parkway Drive | Mason, OH 45040 USA | *phone* +1.513.204.2601 | *fax*+1.513.229.5505 | > *mobile* +1.513.335.1517 | jsmith@MedPlus.com | www.MedPlus.com<http://www.medplus.com/> > > Please think about resource conservation before you print this message > > > > > > *Confidentiality Notice:* The information contained in this electronic > transmission is confidential and may be legally privileged. It is intended > only for the addressee(s) named above. If you are not an intended recipient, > be aware that any disclosure, copying, distribution or use of the > information contained in this transmission is prohibited and may be > unlawful. If you have received this transmission in error, please notify us > by telephone (513) 229-5500 or by email (postmaster@MedPlus.com). After > replying, please erase it from your computer system. > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > cx-freeze-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-freeze-users > > |
From: Smith, J. <js...@me...> - 2009-04-14 16:15:11
|
That worked. There is still a bug in some of the command-line stuff but this setup script does what I need. Thanks! Jeffery G. Smith MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690 Parkway Drive | Mason, OH 45040 USA | phone +1.513.204.2601 | fax +1.513.229.5505 | mobile +1.513.335.1517 | jsmith@MedPlus.com | www.MedPlus.com <http://www.medplus.com/> Please think about resource conservation before you print this message ________________________________ From: Alexandre Andrade [mailto:am...@es...] Sent: Monday, April 13, 2009 3:55 PM To: primary discussion list for use and development of cx_Freeze Subject: Re: [cx-freeze-users] Unable to include multiple modules Hi there, I've take a look in my cx_freeze scripts and found out that I call "setup" as following in order to make it work: setup( executables = [ (...) ], options = { 'build_exe' : { 'includes' : [(...)], 'excludes' : [(...)], } } ) Note that I place the "includes" and "excludes" directives inside "build_exe" dictionary key of the options dictionary. The "options" dictionary is at the same level as the executables, inside the setup call. I hope this is what you're looking for. Best Regards Alexandre Motta de Andrade Configuration Manager www.esss.com.br On Mon, Apr 13, 2009 at 16:38, Smith, Jeff <js...@me...> wrote: Using cx_Freeze 4.0.1 with Python 2.5.4 on Windows XP. I have tried cxfreeze --include-modules=encodings.ascii,encodings.cp437 script.py with the same error as an earlier poster: Usage: cxfreeze [options] [SCRIPT] Freeze a Python script and all of its referenced modules to a base executable which can then be distributed without requiring a Python installation. cxfreeze: error: only one script can be specified As you can see, there are no spaces in my command line. I also tried doing this with a setup script: from cx_Freeze import setup, Executable setup(executables = [Executable('script.py', includes=['encodings.ascii', 'encodings.cp437'])]) using python setup.py build but the listing does not show either of them included: Name File ---- ---- m BUILD_CONSTANTS m UserDict C:\Python25\lib\UserDict.py m __builtin__ m _codecs m _sre m _types m array m codecs C:\Python25\lib\codecs.py m copy C:\Python25\lib\copy.py m copy_reg C:\Python25\lib\copy_reg.py m cx_Freeze__init__ C:\Python25\lib\site-packages\cx_Freeze\initscripts\ Console.py P encodings C:\Python25\lib\encodings\__init__.py m encodings.aliases C:\Python25\lib\encodings\aliases.py m errno m imp m itertools m linecache C:\Python25\lib\linecache.py m nt m ntpath C:\Python25\lib\ntpath.py m os C:\Python25\lib\os.py m popen2 C:\Python25\lib\popen2.py m posixpath C:\Python25\lib\posixpath.py m re C:\Python25\lib\re.py m repr C:\Python25\lib\repr.py m script__main__ script.py m sre_compile C:\Python25\lib\sre_compile.py m sre_constants C:\Python25\lib\sre_constants.py m sre_parse C:\Python25\lib\sre_parse.py m stat C:\Python25\lib\stat.py m string C:\Python25\lib\string.py m strop m sys m types C:\Python25\lib\types.py m warnings C:\Python25\lib\warnings.py m zipimport m zlib Finally I tried a simpler setup script: from cx_Freeze import setup, Executable setup(executables = [Executable('script.py')]) and the command line python setup.py build_exe --includes=encodings.ascii,encodings.cp437 which errors out with running build_exe Traceback (most recent call last): File "setup.py", line 4, in <module> setup(executables = [Executable('script.py')]) File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 278, in setup distutils.core.setup(**attrs) File "C:\Python25\Lib\distutils\core.py", line 151, in setup dist.run_commands() File "C:\Python25\Lib\distutils\dist.py", line 974, in run_commands self.run_command(cmd) File "C:\Python25\Lib\distutils\dist.py", line 994, in run_command cmd_obj.run() File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 165, in run freezer.Freeze() File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 403, in Freeze self.finder = self._GetModuleFinder() File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 251, in _GetMo duleFinder finder.IncludeModule(name) File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 397, in Include Module module = self._ImportModule(name, deferredImports) File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 201, in _Import Module raise ImportError, "No module named %s" % name ImportError: No module named encodings.ascii,encodings.cp437 Is it actually possible to import two encodings this way? What have people done successfully. Maybe something is going wrong in the install of cx_Freeze itself to generate these problems. Jeffery G. Smith MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690 Parkway Drive | Mason, OH 45040 USA | phone +1.513.204.2601 | fax +1.513.229.5505 | mobile +1.513.335.1517 | jsmith@MedPlus.com | www.MedPlus.com <http://www.medplus.com/> Please think about resource conservation before you print this message Confidentiality Notice: The information contained in this electronic transmission is confidential and may be legally privileged. It is intended only for the addressee(s) named above. If you are not an intended recipient, be aware that any disclosure, copying, distribution or use of the information contained in this transmission is prohibited and may be unlawful. If you have received this transmission in error, please notify us by telephone (513) 229-5500 or by email (postmaster@MedPlus.com). After replying, please erase it from your computer system. ------------------------------------------------------------------------ ------ This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com _______________________________________________ cx-freeze-users mailing list cx-...@li... https://lists.sourceforge.net/lists/listinfo/cx-freeze-users Confidentiality Notice: The information contained in this electronic transmission is confidential and may be legally privileged. It is intended only for the addressee(s) named above. If you are not an intended recipient, be aware that any disclosure, copying, distribution or use of the information contained in this transmission is prohibited and may be unlawful. If you have received this transmission in error, please notify us by telephone (513) 229-5500 or by email (postmaster@MedPlus.com). After replying, please erase it from your computer system. |
From: Anthony T. <ant...@gm...> - 2009-04-14 19:43:31
|
Hmm, I tried the command line as follows using the simple sample and didn't run into a problem on Linux. I then tried Windows XP as well and didn't run into a problem. However, I use MSYS on Windows regularly in order to avoid the deficiencies of the command prompt. I now realize one more time why that is. :-) The command prompt argument processor has interesting rules. It splits on equals signs and commas apparently. So, the solution is to tell it to butt out completely and let Python do the command argument parsing instead -- it does a much better job. I have checked in a change to deal with this but the simple solution is to change your cxfreeze.bat file to look like this instead: @echo off c:\Python26\python.exe c:\Python26\Scripts\cxfreeze %* Chalk another one up to the horrible deficiencies of the command prompt on Windows.... Anthony On Tue, Apr 14, 2009 at 10:14 AM, Smith, Jeff <js...@me...> wrote: > That worked. There is still a bug in some of the command-line stuff but > this setup script does what I need. > > Thanks! > > Jeffery G. Smith > MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690 Parkway > Drive | Mason, OH 45040 USA | phone +1.513.204.2601 | fax +1.513.229.5505 | > mobile +1.513.335.1517 | jsmith@MedPlus.com | www.MedPlus.com > > Please think about resource conservation before you print this message > > > ________________________________ > From: Alexandre Andrade [mailto:am...@es...] > Sent: Monday, April 13, 2009 3:55 PM > To: primary discussion list for use and development of cx_Freeze > Subject: Re: [cx-freeze-users] Unable to include multiple modules > > > Hi there, > I've take a look in my cx_freeze scripts and found out that I call "setup" > as following in order to make it work: > setup( > executables = [ > (...) > ], > options = { > 'build_exe' : { > 'includes' : [(...)], > 'excludes' : [(...)], > } > } > ) > Note that I place the "includes" and "excludes" directives inside > "build_exe" dictionary key of the options dictionary. The "options" > dictionary is at the same level as the executables, inside the setup call. > I hope this is what you're looking for. > Best Regards > > Alexandre Motta de Andrade > Configuration Manager > www.esss.com.br > > > On Mon, Apr 13, 2009 at 16:38, Smith, Jeff <js...@me...> wrote: >> >> Using cx_Freeze 4.0.1 with Python 2.5.4 on Windows XP. >> >> I have tried >> cxfreeze --include-modules=encodings.ascii,encodings.cp437 >> script.py >> with the same error as an earlier poster: >> Usage: cxfreeze [options] [SCRIPT] >> >> Freeze a Python script and all of its referenced modules to a base >> executable which can then be distributed without requiring a >> Python >> installation. >> >> cxfreeze: error: only one script can be specified >> >> As you can see, there are no spaces in my command line. I also tried >> doing this with a setup script: >> >> from cx_Freeze import setup, Executable >> setup(executables = [Executable('script.py', >> includes=['encodings.ascii', 'encodings.cp437'])]) >> using >> >> python setup.py build >> >> but the listing does not show either of them included: >> Name File >> ---- ---- >> m BUILD_CONSTANTS >> m UserDict C:\Python25\lib\UserDict.py >> m __builtin__ >> m _codecs >> m _sre >> m _types >> m array >> m codecs C:\Python25\lib\codecs.py >> m copy C:\Python25\lib\copy.py >> m copy_reg C:\Python25\lib\copy_reg.py >> m cx_Freeze__init__ >> C:\Python25\lib\site-packages\cx_Freeze\initscripts\ >> Console.py >> P encodings C:\Python25\lib\encodings\__init__.py >> m encodings.aliases C:\Python25\lib\encodings\aliases.py >> m errno >> m imp >> m itertools >> m linecache C:\Python25\lib\linecache.py >> m nt >> m ntpath C:\Python25\lib\ntpath.py >> m os C:\Python25\lib\os.py >> m popen2 C:\Python25\lib\popen2.py >> m posixpath C:\Python25\lib\posixpath.py >> m re C:\Python25\lib\re.py >> m repr C:\Python25\lib\repr.py >> m script__main__ script.py >> m sre_compile C:\Python25\lib\sre_compile.py >> m sre_constants C:\Python25\lib\sre_constants.py >> m sre_parse C:\Python25\lib\sre_parse.py >> m stat C:\Python25\lib\stat.py >> m string C:\Python25\lib\string.py >> m strop >> m sys >> m types C:\Python25\lib\types.py >> m warnings C:\Python25\lib\warnings.py >> m zipimport >> m zlib >> >> Finally I tried a simpler setup script: >> from cx_Freeze import setup, Executable >> setup(executables = [Executable('script.py')]) >> and the command line >> python setup.py build_exe >> --includes=encodings.ascii,encodings.cp437 >> which errors out with >> running build_exe >> Traceback (most recent call last): >> File "setup.py", line 4, in <module> >> setup(executables = [Executable('script.py')]) >> File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 278, in >> setup >> distutils.core.setup(**attrs) >> File "C:\Python25\Lib\distutils\core.py", line 151, in setup >> dist.run_commands() >> File "C:\Python25\Lib\distutils\dist.py", line 974, in run_commands >> self.run_command(cmd) >> File "C:\Python25\Lib\distutils\dist.py", line 994, in run_command >> cmd_obj.run() >> File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 165, in run >> freezer.Freeze() >> File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 403, in >> Freeze >> >> self.finder = self._GetModuleFinder() >> File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 251, in >> _GetMo >> duleFinder >> finder.IncludeModule(name) >> File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 397, in >> Include >> Module >> module = self._ImportModule(name, deferredImports) >> File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 201, in >> _Import >> Module >> raise ImportError, "No module named %s" % name >> ImportError: No module named encodings.ascii,encodings.cp437 >> >> >> Is it actually possible to import two encodings this way? What have >> people done successfully. Maybe something is going wrong in the install of >> cx_Freeze itself to generate these problems. >> >> >> Jeffery G. Smith >> MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690 >> Parkway Drive | Mason, OH 45040 USA | phone +1.513.204.2601 | fax >> +1.513.229.5505 | mobile +1.513.335.1517 | jsmith@MedPlus.com | >> www.MedPlus.com >> >> Please think about resource conservation before you print this message >> >> >> >> >> Confidentiality Notice: The information contained in this electronic >> transmission is confidential and may be legally privileged. It is intended >> only for the addressee(s) named above. If you are not an intended recipient, >> be aware that any disclosure, copying, distribution or use of the >> information contained in this transmission is prohibited and may be >> unlawful. If you have received this transmission in error, please notify us >> by telephone (513) 229-5500 or by email (postmaster@MedPlus.com). After >> replying, please erase it from your computer system. >> >> >> ------------------------------------------------------------------------------ >> This SF.net email is sponsored by: >> High Quality Requirements in a Collaborative Environment. >> Download a free trial of Rational Requirements Composer Now! >> http://p.sf.net/sfu/www-ibm-com >> _______________________________________________ >> cx-freeze-users mailing list >> cx-...@li... >> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users >> > > > > > Confidentiality Notice: The information contained in this electronic > transmission is confidential and may be legally privileged. It is intended > only for the addressee(s) named above. If you are not an intended recipient, > be aware that any disclosure, copying, distribution or use of the > information contained in this transmission is prohibited and may be > unlawful. If you have received this transmission in error, please notify us > by telephone (513) 229-5500 or by email (postmaster@MedPlus.com). After > replying, please erase it from your computer system. > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > cx-freeze-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-freeze-users > > |
From: Alexandre A. <am...@es...> - 2009-04-15 11:50:39
|
Hi there! We use a command line replacement for Windows called "Take Command", from JPSoft. It's the best! Best Regards Alexandre Andrade Configuration Manager www.esss.com.br On Tue, Apr 14, 2009 at 16:43, Anthony Tuininga <ant...@gm...>wrote: > Hmm, I tried the command line as follows using the simple sample and > didn't run into a problem on Linux. I then tried Windows XP as well > and didn't run into a problem. However, I use MSYS on Windows > regularly in order to avoid the deficiencies of the command prompt. I > now realize one more time why that is. :-) The command prompt argument > processor has interesting rules. It splits on equals signs and commas > apparently. So, the solution is to tell it to butt out completely and > let Python do the command argument parsing instead -- it does a much > better job. I have checked in a change to deal with this but the > simple solution is to change your cxfreeze.bat file to look like this > instead: > > @echo off > > c:\Python26\python.exe c:\Python26\Scripts\cxfreeze %* > > Chalk another one up to the horrible deficiencies of the command > prompt on Windows.... > > Anthony > > On Tue, Apr 14, 2009 at 10:14 AM, Smith, Jeff <js...@me...> wrote: > > That worked. There is still a bug in some of the command-line stuff but > > this setup script does what I need. > > > > Thanks! > > > > Jeffery G. Smith > > MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690 > Parkway > > Drive | Mason, OH 45040 USA | phone +1.513.204.2601 | fax +1.513.229.5505 > | > > mobile +1.513.335.1517 | jsmith@MedPlus.com | www.MedPlus.com > > > > Please think about resource conservation before you print this message > > > > > > ________________________________ > > From: Alexandre Andrade [mailto:am...@es...] > > Sent: Monday, April 13, 2009 3:55 PM > > To: primary discussion list for use and development of cx_Freeze > > Subject: Re: [cx-freeze-users] Unable to include multiple modules > > > > > > Hi there, > > I've take a look in my cx_freeze scripts and found out that I call > "setup" > > as following in order to make it work: > > setup( > > executables = [ > > (...) > > ], > > options = { > > 'build_exe' : { > > 'includes' : [(...)], > > 'excludes' : [(...)], > > } > > } > > ) > > Note that I place the "includes" and "excludes" directives inside > > "build_exe" dictionary key of the options dictionary. The "options" > > dictionary is at the same level as the executables, inside the setup > call. > > I hope this is what you're looking for. > > Best Regards > > > > Alexandre Motta de Andrade > > Configuration Manager > > www.esss.com.br > > > > > > On Mon, Apr 13, 2009 at 16:38, Smith, Jeff <js...@me...> wrote: > >> > >> Using cx_Freeze 4.0.1 with Python 2.5.4 on Windows XP. > >> > >> I have tried > >> cxfreeze --include-modules=encodings.ascii,encodings.cp437 > >> script.py > >> with the same error as an earlier poster: > >> Usage: cxfreeze [options] [SCRIPT] > >> > >> Freeze a Python script and all of its referenced modules to a > base > >> executable which can then be distributed without requiring a > >> Python > >> installation. > >> > >> cxfreeze: error: only one script can be specified > >> > >> As you can see, there are no spaces in my command line. I also tried > >> doing this with a setup script: > >> > >> from cx_Freeze import setup, Executable > >> setup(executables = [Executable('script.py', > >> includes=['encodings.ascii', 'encodings.cp437'])]) > >> using > >> > >> python setup.py build > >> > >> but the listing does not show either of them included: > >> Name File > >> ---- ---- > >> m BUILD_CONSTANTS > >> m UserDict C:\Python25\lib\UserDict.py > >> m __builtin__ > >> m _codecs > >> m _sre > >> m _types > >> m array > >> m codecs C:\Python25\lib\codecs.py > >> m copy C:\Python25\lib\copy.py > >> m copy_reg C:\Python25\lib\copy_reg.py > >> m cx_Freeze__init__ > >> C:\Python25\lib\site-packages\cx_Freeze\initscripts\ > >> Console.py > >> P encodings C:\Python25\lib\encodings\__init__.py > >> m encodings.aliases C:\Python25\lib\encodings\aliases.py > >> m errno > >> m imp > >> m itertools > >> m linecache C:\Python25\lib\linecache.py > >> m nt > >> m ntpath C:\Python25\lib\ntpath.py > >> m os C:\Python25\lib\os.py > >> m popen2 C:\Python25\lib\popen2.py > >> m posixpath C:\Python25\lib\posixpath.py > >> m re C:\Python25\lib\re.py > >> m repr C:\Python25\lib\repr.py > >> m script__main__ script.py > >> m sre_compile C:\Python25\lib\sre_compile.py > >> m sre_constants C:\Python25\lib\sre_constants.py > >> m sre_parse C:\Python25\lib\sre_parse.py > >> m stat C:\Python25\lib\stat.py > >> m string C:\Python25\lib\string.py > >> m strop > >> m sys > >> m types C:\Python25\lib\types.py > >> m warnings C:\Python25\lib\warnings.py > >> m zipimport > >> m zlib > >> > >> Finally I tried a simpler setup script: > >> from cx_Freeze import setup, Executable > >> setup(executables = [Executable('script.py')]) > >> and the command line > >> python setup.py build_exe > >> --includes=encodings.ascii,encodings.cp437 > >> which errors out with > >> running build_exe > >> Traceback (most recent call last): > >> File "setup.py", line 4, in <module> > >> setup(executables = [Executable('script.py')]) > >> File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 278, in > >> setup > >> distutils.core.setup(**attrs) > >> File "C:\Python25\Lib\distutils\core.py", line 151, in setup > >> dist.run_commands() > >> File "C:\Python25\Lib\distutils\dist.py", line 974, in run_commands > >> self.run_command(cmd) > >> File "C:\Python25\Lib\distutils\dist.py", line 994, in run_command > >> cmd_obj.run() > >> File "c:\Python25\lib\site-packages\cx_Freeze\dist.py", line 165, in > run > >> freezer.Freeze() > >> File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 403, > in > >> Freeze > >> > >> self.finder = self._GetModuleFinder() > >> File "c:\Python25\lib\site-packages\cx_Freeze\freezer.py", line 251, > in > >> _GetMo > >> duleFinder > >> finder.IncludeModule(name) > >> File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 397, in > >> Include > >> Module > >> module = self._ImportModule(name, deferredImports) > >> File "c:\Python25\lib\site-packages\cx_Freeze\finder.py", line 201, in > >> _Import > >> Module > >> raise ImportError, "No module named %s" % name > >> ImportError: No module named encodings.ascii,encodings.cp437 > >> > >> > >> Is it actually possible to import two encodings this way? What have > >> people done successfully. Maybe something is going wrong in the install > of > >> cx_Freeze itself to generate these problems. > >> > >> > >> Jeffery G. Smith > >> MedPlus, A Quest Diagnostics Company | Senior SCM Specialist | 4690 > >> Parkway Drive | Mason, OH 45040 USA | phone +1.513.204.2601 | fax > >> +1.513.229.5505 | mobile +1.513.335.1517 | jsmith@MedPlus.com | > >> www.MedPlus.com > >> > >> Please think about resource conservation before you print this message > >> > >> > >> > >> > >> Confidentiality Notice: The information contained in this electronic > >> transmission is confidential and may be legally privileged. It is > intended > >> only for the addressee(s) named above. If you are not an intended > recipient, > >> be aware that any disclosure, copying, distribution or use of the > >> information contained in this transmission is prohibited and may be > >> unlawful. If you have received this transmission in error, please notify > us > >> by telephone (513) 229-5500 or by email (postmaster@MedPlus.com). After > >> replying, please erase it from your computer system. > >> > >> > >> > ------------------------------------------------------------------------------ > >> This SF.net email is sponsored by: > >> High Quality Requirements in a Collaborative Environment. > >> Download a free trial of Rational Requirements Composer Now! > >> http://p.sf.net/sfu/www-ibm-com > >> _______________________________________________ > >> cx-freeze-users mailing list > >> cx-...@li... > >> https://lists.sourceforge.net/lists/listinfo/cx-freeze-users > >> > > > > > > > > > > Confidentiality Notice: The information contained in this electronic > > transmission is confidential and may be legally privileged. It is > intended > > only for the addressee(s) named above. If you are not an intended > recipient, > > be aware that any disclosure, copying, distribution or use of the > > information contained in this transmission is prohibited and may be > > unlawful. If you have received this transmission in error, please notify > us > > by telephone (513) 229-5500 or by email (postmaster@MedPlus.com). After > > replying, please erase it from your computer system. > > > ------------------------------------------------------------------------------ > > This SF.net email is sponsored by: > > High Quality Requirements in a Collaborative Environment. > > Download a free trial of Rational Requirements Composer Now! > > http://p.sf.net/sfu/www-ibm-com > > _______________________________________________ > > cx-freeze-users mailing list > > cx-...@li... > > https://lists.sourceforge.net/lists/listinfo/cx-freeze-users > > > > > > > ------------------------------------------------------------------------------ > This SF.net email is sponsored by: > High Quality Requirements in a Collaborative Environment. > Download a free trial of Rational Requirements Composer Now! > http://p.sf.net/sfu/www-ibm-com > _______________________________________________ > cx-freeze-users mailing list > cx-...@li... > https://lists.sourceforge.net/lists/listinfo/cx-freeze-users > |