[IronPython] Accessing CPython from compiled assemblies

Michael Foord fuzzyman at voidspace.org.uk
Thu Sep 17 13:28:02 CEST 2009


David Escobar wrote:
> I'm using IronPython 2.6 B2 and accessing the CPython 2.6 libraries in 
> the standard way.
>
> import sys
> sys.path.append(r"c:\python26\lib")
>
> When I compile to an .exe, is there a way to link in the CPython 
> libraries I'm using? Otherwise I get an ImportError when I run the 
> application on a machine that does not have CPython 2.6 installed. Thanks.

Are you compiling to exe with the Pyc compiler? If so you will also need 
to compile the standard library modules that you use (*instead* of 
adding them to the path).

Another technique is to have your own version of the standard library 
(or just the parts you use) in a directory in the same folder as your 
exe - and add *this* directory to the path instead.

Michael

> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>   


-- 
http://www.ironpythoninaction.com/




More information about the Ironpython-users mailing list