[IronPython] StringIO???
Martin Maly
martmaly at exchange.microsoft.com
Thu May 19 05:57:12 CEST 2005
Or what you can also do is point IronPython to your StringIO.py
directory:
import sys
sys.path.append( <your Python 2.3.5 lib directory>)
import StringIO
Martin
________________________________
From: users-ironpython.com-bounces at lists.ironpython.com
[mailto:users-ironpython.com-bounces at lists.ironpython.com] On Behalf Of
Anthony Tarlano
Sent: Wednesday, May 18, 2005 12:56 PM
To: Discussion of IronPython
Subject: Re: [IronPython] StringIO???
Kbond,
You need to replace the Lib directory in IronPython-0.7.5 with
the standard library modules Lib directory from Python2.3.. Once you
have done this you will have StringIO..
As for your ? you can use the version string contained on the
first interpeter line "IronPython 0.7.5 on .NET 2.0.50215.44" to
determine the .NET version or look in the "Add/Remove Programs" window
in the ControlPanel. You are all set since you have beta 2.
Anthony
On 5/18/05, kbond at free.fr <kbond at free.fr> wrote:
Hello,
I do have a problem to import StringIO.
I have seen that you are explaining this error my not
having the latest version
of the .Net framework.
How can I check the version of the .Net framewaork
installed on my computer?
I think it is the beta 2 but I am not sure.
Thank you for your help.
Here it is the error I am getting:
with the latest build O.7.5
IronPython 0.7.5 on .NET 2.0.50215.44
Copyright (c) Microsoft Corporation. All rights
reserved.
>>>
()
>>> import StringIO
IronPython.Objects.PythonImportError: No module named
StringIO
at IronPython.Modules.__builtin__.__import__(String
name, Object globals, Obj
ect locals, Object fromList)
at
ReflectOpt.IronPython.Modules.__builtin__.__import__(Object , Object ,
Obj
ect , Object )
at IronPython.Objects.BuiltinFunction.Call(Object
arg0, Object arg1, Object a
rg2, Object arg3)
at IronPython.Objects.Ops.Call (Object func, Object
arg0, Object arg1, Object
arg2, Object arg3)
at IronPython.Objects.Importer.Import(PythonModule
mod, String fullName, List
from)
at IronPython.Objects.Ops.Import(PythonModule mod,
String fullName)
at input_1.Run(Frame frame)
at
IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame)
at IronPython.Hosting.PythonEngine.RunInteractive()
>>>
with the latest build O.7.4
IronPython 0.7.4 on .NET 2.0.50215.44
Copyright (c) Microsoft Corporation. All rights
reserved.
>>> import StringIO
IronPython.Objects.PythonImportError: No module named
StringIO
at IronPython.Modules.__builtin__.__import_ _(String
name, Object globals, Obj
ect locals, Object fromList)
at
ReflectOpt.IronPython.Modules.__builtin__.__import__(Object , Object ,
Obj
ect , Object )
at IronPython.Objects.BuiltinFunction.Call(Object
arg0, Object arg1, Object a
rg2, Object arg3)
at IronPython.Objects.Ops.Call(Object func, Object
arg0, Object arg1, Object
arg2, Object arg3)
at IronPython.Objects.Importer.Import(PythonModule
mod, String fullName, List
from)
at IronPython.Objects.Ops.Import(PythonModule mod,
String fullName)
at input_0.Run(Frame frame)
at
IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame)
at IronPython.Hosting.PythonEngine.RunInteractive ()
>>>
Martin,
Just as a F.Y.I, IP-0.7.5 did fix it the problem, but as
you can also see
from below IP-0.7.4 with Beta 1 did work before.
---- IP-0.7.5 with Beta 2
IronPython 0.7.5 on .NET 2.0.50215.44
Copyright (c) Microsoft Corporation. All rights
reserved.
>>> import StringIO
>>> dir(StringIO)
['ValueError', 'ImportError', 'RuntimeError',
'basestring', 'isinstance',
'Strin
gIO', 'None', 'False', 'open', 'EINVAL', '__name__',
'str', 'min', 'max',
'len',
'IOError', 'test', 'StopIteration', '__all__', '_',
'__builtins__',
'__file__']
>>>
---- IP-0.7.5 with Beta 1
IronPython 0.7.5 on .NET 2.0.40607.42
Copyright (c) Microsoft Corporation. All rights
reserved.
>>> import StringIO
System.MissingMethodException: Method not found:
'Boolean
System.Collections.Gen
eric.IDictionary`2.TryGetValue(!0, !1 ByRef)'.
at
IronPython.Objects.Importer.TryGetExistingModule(String fullName,
Object&
ret)
at IronPython.Objects.Importer.Import(PythonModule mod,
String fullName,
List
from)
at IronPython.Objects.Ops.Import(PythonModule mod,
String fullName)
at input_0.Run(Frame frame)
at
IronPython.Hosting.PythonEngine.DoOneInteractive(Frame topFrame)
at IronPython.Hosting.PythonEngine.RunInteractive ()
>>>
---- IP-0.7.4 with Beta 1
IronPython 0.7.4 on .NET 2.0.40607.42
Copyright (c) Microsoft Corporation. All rights
reserved.
>>> import StringIO
>>>
On 5/18/05, Anthony Tarlano < mailinglist.account at
gmail.com> wrote:
>
> Martin,
>
> Yes indeed it is strange since it worked just fine
with the previous
> build. I will upgrade and let you know if that fixes
the problem.
>
> Thanks,
>
> Anthony
>
> On 5/18/05, Martin Maly <martmaly at
exchange.microsoft.com> wrote:
> >
> > Strange that someone reported similar thing on
GotDotNet forums. I
> > believe that the cause is an old version of .Net.
> > You need .Net 2.0 Beta 2 to run IronPython:
> > IronPython 0.7.5 on .NET *2.0.50215.44*
> > Copyright (c) Microsoft Corporation. All rights
reserved.
> > >>> import StringIO
> > >>>
> > You can get Beta 2 from here:
> >
http://www.microsoft.com/downloads/details.aspx?familyid=7ABD8C8F-287E-4
C7E-9A4A-A4ECFF40FC8E&displaylang=en
> >
> > ------------------------------
> > *From:* users-ironpython.com-bounces at
lists.ironpython.com [mailto:
> > users-ironpython.com-bounces at
lists.ironpython.com] *On Behalf Of *Anthony
> > Tarlano
> > *Sent:* Tuesday, May 17, 2005 3:02 PM
> > *To:* Discussion of IronPython
> > *Subject:* [IronPython] StringIO???
> >
> > Martin,
> >
> > I think that while fixing the 'assemblies in the
same directory' bug, a
> > new critter may have been introduced...
> >
> > StringIO used to work in IP-0.7.4, now using
IP.0.7.5 I see the
> > following trackback..
> >
> > IronPython 0.7.5 on .NET 2.0.40607.42
> > Copyright (c) Microsoft Corporation. All rights
reserved.
> > >>> import StringIO
> > System.MissingMethodException: Method not found:
'Boolean
> > System.Collections.Gen
> > eric.IDictionary`2.TryGetValue(!0, !1 ByRef)'.
> > at
IronPython.Objects.Importer.TryGetExistingModule(String fullName,
> > Object&
> > ret)
> > at IronPython.Objects.Importer.Import (PythonModule
mod, String fullName,
> > List
> > from)
> > at IronPython.Objects.Ops.Import(PythonModule mod,
String fullName)
> > at input_0.Run(Frame frame)
> > at IronPython.Hosting.PythonEngine.DoOneInteractive
(Frame topFrame)
> > at IronPython.Hosting.PythonEngine.RunInteractive()
> > >>>
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://listserver.dreamhost.com/pipermail/users-ironpython.com/attachmen
ts/20050518/f6e9809f/attachment-0001.htm
_______________________________________________
users-ironpython.com mailing list
users-ironpython.com at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20050518/6fd28186/attachment.html>
More information about the Ironpython-users
mailing list