<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>These assemblies should automatically be loaded by the CLR
before the IronPython engine is ever started. If you&#8217;re able to execute &#8220;import
clr&#8221;, then they have already been loaded successfully.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>The purpose of clr.AddReference is to make assemblies available
from Python, so it is only necessary if the Python code itself calls into these
DLLs.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>One finer point: System and mscorlib are special because IronPython
adds references to them by default. At some point in the past, pyc.py failed to
add these references by default, which broke any pyc-compiled scripts that tried
to call into these DLLs (e.g. &#8220;import System&#8221;). As a workaround, we
recommended including clr.AddReference(&#8216;System&#8217;) and
clr.AddReference(&#8216;mscorlib&#8217;) at the beginning of such pyc-compiled
scripts, but this is no longer required because the bug has been fixed.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>- David<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p>&nbsp;</o:p></span></p>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
users-bounces@lists.ironpython.com [mailto:users-bounces@lists.ironpython.com] <b>On
Behalf Of </b>Bruce Bromberek<br>
<b>Sent:</b> Thursday, April 29, 2010 4:18 PM<br>
<b>To:</b> Discussion of IronPython<br>
<b>Subject:</b> Re: [IronPython] Dirstributing scripts as Exe<o:p></o:p></span></p>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

<p class=MsoNormal>You also have to watch that the IronPython automatically
loads some assemblies that pyc does not. &nbsp;It may be overkill but I
reference the following in every script I make into an exe.<o:p></o:p></p>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<div>

<p class=MsoNormal>#Key IronPython References needed for final EXE when
IronPython is not installed<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('IronPython')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('IronPython.Modules')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('Microsoft.Dynamic')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('Microsoft.Scripting')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('Microsoft.Scripting.Core')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('Microsoft.Scripting.Debugging')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('Microsoft.Scripting.ExtensionAttribute')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('mscorlib')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('System')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>clr.AddReference('System.Data')<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><o:p>&nbsp;</o:p></p>

<div>

<p class=MsoNormal>On Thu, Apr 29, 2010 at 5:13 PM, David DiCato &lt;<a
href="mailto:ddicato@microsoft.com">ddicato@microsoft.com</a>&gt; wrote:<o:p></o:p></p>

<p class=MsoNormal>This is probably an assembly load failure. Try copying
&quot;c:\Program Files\IronPython 2.6&quot;\*.dll into your program directory.
You will also need to make sure that sys.path is properly set if you're using
the CPython standard lib for anything.<br>
<br>
We realize this is kind of an undesirable workaround, which is why we're
planning to put all of IronPython's required DLLs in the GAC at some point in
the future.<br>
<span style='color:#888888'><br>
- David</span><o:p></o:p></p>

<div>

<p class=MsoNormal><br>
-----Original Message-----<br>
From: <a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>
[mailto:<a href="mailto:users-bounces@lists.ironpython.com">users-bounces@lists.ironpython.com</a>]
On Behalf Of Mico Siahaan<o:p></o:p></p>

</div>

<div>

<p class=MsoNormal>Sent: Thursday, April 29, 2010 3:04 PM<br>
To: <a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><o:p></o:p></p>

</div>

<div>

<div>

<p class=MsoNormal>Subject: [IronPython] Dirstributing scripts as Exe<br>
<br>
Dear all,<br>
<br>
In CPython there is py2exe to distribute scripts as exe. I notice<br>
there is pyc.py scripts in IronPython\Tools. I tried to use pyc to<br>
compile one simple script. It produced an exe file. But when I tried<br>
to run the exe file, Windows complained: 'Windows stop working...'.<br>
Did I do something wrong?<br>
<br>
--<br>
Mico | <a href="mailto:mico.siahaan@gmail.com">mico.siahaan@gmail.com</a> |
@bangmico<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com"
target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com"
target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><o:p></o:p></p>

</div>

</div>

</div>

<p class=MsoNormal><o:p>&nbsp;</o:p></p>

</div>

</div>

</div>

</body>

</html>