[IronPython] Transparent import of dlls?

2011-03-29 Thread Markus Schaber
Hi, I have some questions that may seem stupid, but I did not find the right answers yet. So simple pointers to the correct google query are as welcome as elaborate Howtos. J For cPython, it is possible to compile a module into a .pyc file. If this file resides in sys.path, it is

Re: [IronPython] Transparent import of dlls?

2011-03-29 Thread Jeff Hardy
On Tue, Mar 29, 2011 at 4:30 AM, Markus Schaber m.scha...@3s-software.com wrote: For IronPython, there is the pyc.py compiler script. This allows a python module to be precompiled into a .NET dll. However, it seems that it is not used transparently when placed in a directory in sys.path, one

Re: [IronPython] IronPython2.7 import locking error

2011-03-25 Thread amy yau
@lists.ironpython.com Subject: Re: [IronPython] IronPython2.7 import locking error what I can see is when I import msvcrt on Python2.5 console and do a dir(msvcrt). it has a method called locking but when I import msvcrt on IronPython2.7 it does not have the method locking. What I can do is I

Re: [IronPython] IronPython2.7 import locking error

2011-03-25 Thread Jeff Hardy
On Thu, Mar 24, 2011 at 6:41 PM, Dino Viehland di...@microsoft.com wrote: Oh I see I missed the line containing msvcrt.  This just looks like it hasn't been implemented (we still have only a very partially implemented version of msvcrt).  It should be trivial to do add this , it should just

Re: [IronPython] IronPython2.7 import locking error

2011-03-25 Thread Dino Viehland
, March 25, 2011 11:08 AM To: Discussion of IronPython Cc: Dino Viehland Subject: Re: [IronPython] IronPython2.7 import locking error On Thu, Mar 24, 2011 at 6:41 PM, Dino Viehland di...@microsoft.com wrote: Oh I see I missed the line containing msvcrt.  This just looks like it hasn't been

Re: [IronPython] IronPython2.7 import locking error

2011-03-25 Thread Jeff Hardy
. Note to self: FileStream.SafeFileHandle. - Jeff -Original Message- From: Jeff Hardy [mailto:jdha...@gmail.com] Sent: Friday, March 25, 2011 11:08 AM To: Discussion of IronPython Cc: Dino Viehland Subject: Re: [IronPython] IronPython2.7 import locking error On Thu, Mar 24, 2011

[IronPython] IronPython2.7 import locking error

2011-03-24 Thread amy yau
Hi I have some python library which compiled fine using Python2.5 But when using ironPython2.7 I got the following error from the console: from msvcrt import locking Traceback (most recent call last): File stdin, line 1, in module importError: Cannot import name locking I do not get

Re: [IronPython] IronPython2.7 import locking error

2011-03-24 Thread Dino Viehland
@lists.ironpython.com Subject: [IronPython] IronPython2.7 import locking error Hi I have some python library which compiled fine using Python2.5 But when using ironPython2.7 I got the following error from the console: from msvcrt import locking Traceback (most recent call last): File stdin, line 1

Re: [IronPython] IronPython2.7 import locking error

2011-03-24 Thread amy yau
what I can see is when I import msvcrt on Python2.5 console and do a dir(msvcrt). it has a method called locking but when I import msvcrt on IronPython2.7 it does not have the method locking. What I can do is I will try to find out what the python lib does using this msvcrt module and modify it

Re: [IronPython] IronPython2.7 import locking error

2011-03-24 Thread Dino Viehland
. -Original Message- From: users-boun...@lists.ironpython.com [mailto:users-boun...@lists.ironpython.com] On Behalf Of amy yau Sent: Thursday, March 24, 2011 4:45 PM To: users@lists.ironpython.com Subject: Re: [IronPython] IronPython2.7 import locking error what I can see is when I import msvcrt

[IronPython] Cannot import 'Networkx' into Ironpython

2011-01-25 Thread Federico Vaggi
Hello, I am a very new user to Ironpython, so hopefully I am not missing anything obvious. I read the FAQ and searched the Ironpython site and I couldn't find a solution to the problem I was having. I have installed both CPython 2.7 and Ironpython 2.7 (the alpha version) and I am

Re: [IronPython] Cannot import 'Networkx' into Ironpython

2011-01-25 Thread Jeff Hardy
It looks like networkx is a pure-Python package, so it should work. What are you adding sys.path? I cloned the repo into the networkx folder, which contains a networkx folder - sys.path should point to the outer folder. sys.path.append(r'C:\Users\user\Documents\Repositories\networkx') Doing

Re: [IronPython] Cannot import 'Networkx' into Ironpython

2011-01-25 Thread Federico Vaggi
Hi Jeff, my python directory looks like this: C:\Python27\Lib\site-packagesdir Volume in drive C is OS Volume Serial Number is CA49-670D Directory of C:\Python27\Lib\site-packages 25/01/2011 16:37 DIR . 25/01/2011 16:37 DIR .. 20/09/2006 18:05 126

Re: [IronPython] Cannot import 'Networkx' into Ironpython

2011-01-25 Thread Jeff Hardy
On Tue, Jan 25, 2011 at 9:07 AM, Federico Vaggi va...@cosbi.eu wrote: I added: sys.path.append(rC:\Python27\Lib\site-packages\networkx) to site.py in the ironpython folder and this is not enough to get ironpython to see it, but it is enough to get cpython to see it without any further

[IronPython] cant import os

2010-12-28 Thread E. Antero Tammi
Hello, I'm new to this list, but figured out that this would be most suitable place to ask following question. Shortly, I just installed latest (2.7) IronPython and it seems to be a very cool implementation indeed, but encountered soon an odd problem: In console I can just » import os

Re: [IronPython] cant import os

2010-12-28 Thread Jeff Hardy
What's happening here is that VS actually uses its own copy of IronPython, not the installed one. The copy used by VS does not include the Python stdlib. On Tue, Dec 28, 2010 at 2:23 PM, E. Antero Tammi e.antero.ta...@gmail.com wrote: So I think my question is actually twofold: - is the above

[IronPython] Dynamically import namespace from C# DLL

2010-07-27 Thread Danny Fernandez
I am trying to figure out how to import types from a namesapce at run time. I can do a from ... import * but my goal is only to to import the types only when I need access to those types from a namespace and the namespace is not known until it is calculated by a request. I tried the simpliest and

Re: [IronPython] Dynamically import namespace from C# DLL

2010-07-27 Thread Dino Viehland
...@lists.ironpython.com] On Behalf Of Danny Fernandez Sent: Tuesday, July 27, 2010 1:37 PM To: Discussion of IronPython Subject: [IronPython] Dynamically import namespace from C# DLL I am trying to figure out how to import types from a namesapce at run time. I can do a from ... import * but my goal is only

Re: [IronPython] Dynamically import namespace from C# DLL

2010-07-27 Thread Danny Fernandez
-level namespace so you’ll need to handle each dot yourself. *From:* users-boun...@lists.ironpython.com [mailto: users-boun...@lists.ironpython.com] *On Behalf Of *Danny Fernandez *Sent:* Tuesday, July 27, 2010 1:37 PM *To:* Discussion of IronPython *Subject:* [IronPython] Dynamically import

Re: [IronPython] Cannot import module from .dll directly

2010-05-19 Thread Jeff Hardy
On Tue, May 18, 2010 at 5:31 PM, Dino Viehland di...@microsoft.com wrote: What if we required the extension to be named _foo.ipyd or _foo.ipe or something along those lines which would be similar to CPython's .pyd extension?  That way we wouldn't be querying random DLLs that might or might not

Re: [IronPython] Cannot import module from .dll directly

2010-05-19 Thread Zach Crowell
Unfortunately there doesn't seem to be any way to change the extension of a class library from .dll (other than a post-build step), so you should go bug the VS team about that :) The TargetExt property controls this in the C# build system, so you can put something like

[IronPython] Cannot import module from .dll directly

2010-05-17 Thread Jeff Hardy
When CPython is searching for modules to import, it will check all the folders in sys.path for .py, .pyc/.pyo, and .pyd/.dll files that match the requested import. For IronPython, .py is obviously supported, .pyc/.pyo are obviously(?) not, and neither are .pyd/.dll. Is there any particular reason

Re: [IronPython] Hosted IronPython cannot import error

2009-09-11 Thread Dave Fugate
: [IronPython] Hosted IronPython cannot import error Hi. I have been trying to implement a hosted IronPython solution in C#. I have been successful at executing basic python code, but I am having problems when trying to import a module. The module I am trying to call is the packetlogic API

Re: [IronPython] Hosted IronPython cannot import error

2009-09-11 Thread William Reade
@lists.ironpython.com *Subject:* [IronPython] Hosted IronPython cannot import error Hi. I have been trying to implement a hosted IronPython solution in C#. I have been successful at executing basic python code, but I am having problems when trying to import a module. The module I am trying to call

Re: [IronPython] Hosted IronPython cannot import error

2009-09-11 Thread Blosser, Peter
Thanks for the link, I wasn't aware that IronPython would not import pyd. That page you linked me to mentioned that there was a project for IronPython called Ironclad that would allow importing of pyd files. I got ironclad, imported it and everything started working! Awesome! Thanks for all

[IronPython] slow import time

2009-01-27 Thread Renaud Durand
Hi, I know it must be a recurrent question. But why IronPython startup time is so long ? I have a Winforms App that takes around 15s to start. The first import starts at about 10s, so importing modules takes about 5 seconds. I Know that the 10 first seconds seem to be incompressible... But is

Re: [IronPython] Cannot import name Enum

2008-07-13 Thread Jeff Hardy
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff Hardy Sent: Thursday, July 10, 2008 5:27 PM To: Discussion of IronPython Subject: [IronPython] Cannot import name Enum Hi all, I'm hosting IronPython 2.0b3. When executing from System import Enum, I get the error Cannot import name

[IronPython] Cannot import name Enum

2008-07-10 Thread Jeff Hardy
Hi all, I'm hosting IronPython 2.0b3. When executing from System import Enum, I get the error Cannot import name Enum . It works fine when executed from the console. Do I need to set up some references in the hosting code to make this work? -Jeff ___

Re: [IronPython] Cannot import name Enum

2008-07-10 Thread Srivatsn Narayanan
of IronPython Subject: [IronPython] Cannot import name Enum Hi all, I'm hosting IronPython 2.0b3. When executing from System import Enum, I get the error Cannot import name Enum . It works fine when executed from the console. Do I need to set up some references in the hosting code to make this work? -Jeff

Re: [IronPython] Cannot import name Enum

2008-07-10 Thread Han Kejing
Hardy Sent: 2008年7月11日 8:27 To: Discussion of IronPython Subject: [IronPython] Cannot import name Enum Hi all, I'm hosting IronPython 2.0b3. When executing from System import Enum, I get the error Cannot import name Enum . It works fine when executed from the console. Do I need to set up some

Re: [IronPython] No import this?

2008-01-14 Thread Dino Viehland
Seruyange Sent: Monday, January 14, 2008 10:53 AM To: Discussion of IronPython Subject: [IronPython] No import this? Does IronPython strip the easter egg? Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.http://us.rd.yahoo.com/evt

Re: [IronPython] No import this?

2008-01-14 Thread Sanghyeon Seo
David Seruyange wrote: Does IronPython strip the easter egg? 2008/1/15, Dino Viehland [EMAIL PROTECTED]: We just don't include the standard library by default (which is where this comes from). If you set IRONPYTHONPATH=C:\Python25\Lib (or wherever your Python lib dir is) or you start

Re: [IronPython] No import this?

2008-01-14 Thread Dino Viehland
Wow, that's cute, and it's actually implemented in the runtime. From: [EMAIL PROTECTED] [EMAIL PROTECTED] On Behalf Of Sanghyeon Seo [EMAIL PROTECTED] Sent: Monday, January 14, 2008 3:38 PM To: Discussion of IronPython Subject: Re: [IronPython] No import

Re: [IronPython] [python] Import Performance

2007-12-27 Thread Davy Mitchell
Hi All, Okay had a go at narrowing down the issue - appears to be the 'import compiler' line taking around 2 seconds. The importing seems pretty fast - possibly the exceptions in IronPython being generated causing the slowdown. Here's the test code I used: import sys import datetime print

Re: [IronPython] [python] Import Performance

2007-12-26 Thread Michael Foord
Davy Mitchell wrote: I was curious as to why one of my apps was taking so long to start up. Sure it loaded up some RSS feeds but it shouldn't take *that* long. Anyway turns out to be 4-5 seconds importing configobj import datetime print datetime.datetime.now() from configobj import

Re: [IronPython] [python] Re: Embedding CPython Messes with the IronPython 2 Import Mechanism

2007-11-02 Thread Michael Foord
PROTECTED] On Behalf Of Michael Foord Sent: Friday, November 02, 2007 3:25 PM To: Discussion of IronPython Subject: [IronPython] Embedding CPython Messes with the IronPython 2 Import Mechanism Hello Guys, Not sure what is going on here, nor whether it indicates a bug in IronPython

[IronPython] Embedding CPython Messes with the IronPython 2 Import Mechanism

2007-11-02 Thread Michael Foord
Hello Guys, Not sure what is going on here, nor whether it indicates a bug in IronPython, but it is certainly odd. Loading a CPython interpreter through the Python.NET assembly seems to change the IronPython (2a5) import machinery. I have a test module 'xyzz.py' that has an unused name

Re: [IronPython] [python] Re: Embedding CPython Messes with the IronPython 2 Import Mechanism

2007-11-02 Thread Dino Viehland
Messes with the IronPython 2 Import Mechanism I'm not sure what's going on here - I've pinged the CLR dev who owns this feature. In some patches (at some point) post v2.0.50727.42 there were some changes made to Ref.Emit w.r.t. ModuleBuilder's vs. Modules - this looks like it could be a regression

Re: [IronPython] [python] Re: Embedding CPython Messes with the IronPython 2 Import Mechanism

2007-11-02 Thread Michael Foord
] On Behalf Of Dino Viehland Sent: Friday, November 02, 2007 4:12 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Embedding CPython Messes with the IronPython 2 Import Mechanism I'm not sure what's going on here - I've pinged the CLR dev who owns this feature. In some patches

Re: [IronPython] [python] Re: Embedding CPython Messes with the IronPython 2 Import Mechanism

2007-11-02 Thread Dino Viehland
: [IronPython] [python] Re: Embedding CPython Messes with the IronPython 2 Import Mechanism Dino Viehland wrote: Are you running on a beta of Orcas? It could be an Orcas bug. I have the Orcas beta installed (which I guess means yes). I don't have it on my laptop - I can try with that. Michael

Re: [IronPython] [python] Re: Embedding CPython Messes with the IronPython 2 Import Mechanism

2007-11-02 Thread Michael Foord
: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Foord Sent: Friday, November 02, 2007 4:33 PM To: Discussion of IronPython Subject: Re: [IronPython] [python] Re: Embedding CPython Messes with the IronPython 2 Import Mechanism Dino Viehland wrote: Are you running on a beta

Re: [IronPython] [python] Import Now

2007-10-07 Thread Michael Foord
Davy Mitchell wrote: IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.50727.312 Copyright (c) Microsoft Corporation. All rights reserved. from System.DateTime import Now print Now 07/10/2007 21:23:20 print a few seconds later + Now.ToString() a few

Re: [IronPython] [python] Import Now

2007-10-07 Thread Davy Mitchell
Yeah sounds reasonable but a little clunky :-) Davy On 10/7/07, Michael Foord [EMAIL PROTECTED] wrote: Davy Mitchell wrote: IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.50727.312 Copyright (c) Microsoft Corporation. All rights reserved. from System.DateTime import Now

Re: [IronPython] [Bug] import System enables .NET methods

2007-07-29 Thread Dino Viehland
To: Discussion of IronPython Subject: [IronPython] [Bug] import System enables .NET methods Hello all, My understanding was that 'import clr' in a module was supposed to enable .NET methods. 'import System' also has the same effect. Try the following (either from an interactive session or run

Re: [IronPython] [Bug] import System enables .NET methods

2007-07-28 Thread Luis M. Gonzalez
Hi there, This is strange, but this one is weird: 'hello world'.Upper() 'HELLO WORLD' Luis - Original Message - From: Michael Foord [EMAIL PROTECTED] To: Discussion of IronPython users@lists.ironpython.com Sent: Saturday, July 28, 2007 10:06 AM Subject: [IronPython] [Bug] import

[IronPython] Can't import System?

2007-07-09 Thread Dan Eloff
I created a winforms project in IronPython, compiled it and it worked great. Then I made some changes and now it says it can't import any of the .NET assemblies. FileNotFoundError: Could not load file or assembly 'System.Data' or one of its dependencies. The system cannot find the file specified.

Re: [IronPython] Can't import System?

2007-07-09 Thread Dino Viehland
] On Behalf Of Dan Eloff Sent: Monday, July 09, 2007 10:33 AM To: IronPython Mailing List Subject: [IronPython] Can't import System? I created a winforms project in IronPython, compiled it and it worked great. Then I made some changes and now it says it can't import any of the .NET assemblies

Re: [IronPython] Can't import System?

2007-07-09 Thread Dan Eloff
] On Behalf Of Dan Eloff Sent: Monday, July 09, 2007 10:33 AM To: IronPython Mailing List Subject: [IronPython] Can't import System? I created a winforms project in IronPython, compiled it and it worked great. Then I made some changes and now it says it can't import any of the .NET assemblies

Re: [IronPython] wierd import problem

2007-04-23 Thread Dino Viehland
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tony Djordjevski Sent: Monday, April 23, 2007 2:15 PM To: Discussion of IronPython Subject: Re: [IronPython] wierd import problem Hi Dino, Sorry, I should have mentioned in my original post that I've already tried to get it to work

Re: [IronPython] wierd import problem

2007-04-23 Thread Simon Dahlbacka
On 4/24/07, Dino Viehland [EMAIL PROTECTED] wrote: Oh, it seems to be the presence of the '.dll' in the filename (although I still haven't looked too deeply to understand the exception). See below for the 3 different variations I've tried. The .NET loader will append .dll/.exe for you

Re: [IronPython] wierd import problem

2007-04-23 Thread Dino Viehland
, April 23, 2007 2:29 PM To: Discussion of IronPython Subject: Re: [IronPython] wierd import problem On 4/24/07, Dino Viehland [EMAIL PROTECTED]mailto:[EMAIL PROTECTED] wrote: Oh, it seems to be the presence of the '.dll' in the filename (although I still haven't looked too deeply to understand

Re: [IronPython] Another import strangeness

2006-10-25 Thread Sanghyeon Seo
2006/10/25, Sanghyeon Seo [EMAIL PROTECTED]: Import bugs seem to be especially difficult to reduce the testcase, since it's often unclear what the hell is going on. Oops, this is a duplicate of CodePlex issue 2648, and actually found from the same code. Sorry for the noise.

[IronPython] Another import strangeness

2006-10-24 Thread Sanghyeon Seo
Import bugs seem to be especially difficult to reduce the testcase, since it's often unclear what the hell is going on. Reduced from some large bunch o' code: $ ipy test.py False $ python test.py True File contents follow: # test.py import a print hasattr(a, 'c') # a/__init__.py import b #

[IronPython] can't import nt

2006-03-29 Thread Mathew Yeates
Hi From the IronPython Console I try and import nt (I need to spawn a process) but I get ImportError: no module named nt. Anybody know why? I can import other modules like errno. Mathew ___ users mailing list users@lists.ironpython.com

Re: [IronPython] can't import nt

2006-03-29 Thread Dino Viehland
] [mailto:[EMAIL PROTECTED] On Behalf Of Mathew Yeates Sent: Wednesday, March 29, 2006 1:02 PM To: Discussion of IronPython Subject: [IronPython] can't import nt Hi From the IronPython Console I try and import nt (I need to spawn a process) but I get ImportError: no module named nt. Anybody know

Re: [IronPython] can't import nt

2006-03-29 Thread Mathew Yeates
/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mathew Yeates Sent: Wednesday, March 29, 2006 1:02 PM To: Discussion of IronPython Subject: [IronPython] can't import nt Hi From

Re: [IronPython] can't import nt

2006-03-29 Thread Dino Viehland
- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mathew Yeates Sent: Wednesday, March 29, 2006 1:09 PM To: Discussion of IronPython Subject: Re: [IronPython] can't import nt I'm running mono on Linux. I just tried import unix and that didnt work either Mathew Dino Viehland

Re: [IronPython] can't import nt

2006-03-29 Thread Mathew Yeates
-DC1B43134038) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mathew Yeates Sent: Wednesday, March 29, 2006 1:09 PM To: Discussion of IronPython Subject: Re: [IronPython] can't import nt I'm running mono on Linux. I just tried import unix and that didnt

Re: [IronPython] can't import nt

2006-03-29 Thread Travis Watkins
On 3/29/06, Mathew Yeates [EMAIL PROTECTED] wrote: bingo! It's usually a good idea to just import the os module. it's a wrapper (at least in cpython) around the nt, posix, etc modules so you can use it anywhere. -- Travis Watkins http://www.realistanew.com

Re: [IronPython] infinite import loop for nested packages (and fix)

2006-03-02 Thread Martin Maly
: [IronPython] infinite import loop for nested packages (and fix) If you have a directory on your python path like so: foo/ __init__.py: import foo.bar as bar bar/ __init__.py: import foo.bar.baz as baz baz.py: print 'Baz imported' testit.py: import foo.bar And you run testit.py, the import

Re: [IronPython] Double-Import Bug

2005-05-17 Thread Curt Hagenlocher
On May 17, 2005, at 10:42 PM, Curt Hagenlocher wrote: I believe that this behavior is consistent with that of CPython. Consistent with CPython 2.4. The behavior has changed. Figures. I'm still using 1.5.2 :) -- Curt Hagenlocher [EMAIL PROTECTED]