[IronPython] Red Flag(?) change in "import"

Federico Vaggi vaggi at cosbi.eu
Thu Feb 10 11:42:57 CET 2011


  I ran into a relatively similar problem with importing networkx into 
IronPython, but was able to fix it by editing out a few of the lines.  
It seems that the import behaviour in cpython and ironpython is slightly 
different sometime.

I can post a list of the steps that I took if it is helpful at all.

Federico
On 09/02/2011 23:45, Vernon Cole wrote:
> I can't see an item like this on the bug list. Perhaps the sky is 
> falling, perhaps, not. I am reporting the problem here in case it is. 
> It seems like something the "big guns" should be made aware of right 
> away.  The behavior seems to have changed since IPy 2.6, and if 
> someone has indeed been working on "import" then we have a regression.
>
> First.... here's CPython 2.7 -- I install the package and then import 
> it from another directory...
> <console dump>
> C:\hg\adodbapi>py27 setup.py install
>
> C:\hg\adodbapi>c:\python27\python.exe setup.py install
> adodbapi version="2.4.0.2"
> running install
> running build
> running build_py
> copying adodbapi.py -> build\lib\adodbapi
> copying ado_consts.py -> build\lib\adodbapi
> copying __init__.py -> build\lib\adodbapi
> running install_lib
> copying build\lib\adodbapi\adodbapi.py -> 
> c:\python27\Lib\site-packages\adodbapi
>
> running install_egg_info
> Writing c:\python27\Lib\site-packages\adodbapi-2.4.0.2-py2.7.egg-info
>
> C:\hg\adodbapi>home
>
> C:\hg\adodbapi>C:
>
> C:\hg\adodbapi>cd \Users\vernon
> C:\Users\vernon>py27
>
> C:\Users\vernon>c:\python27\python.exe
>
> Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit 
> (Intel)] on win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import adodbapi
> >>> adodbapi.version
> 'adodbapi v2.4.0.2'
> </console>
> ...................  The version attribute works
>
> Now I try the same thing on an administrator console (I think that 
> IronPython is correct in required the higher privilege here)
> and a big THANK YOU for having a working distutils!     ........
> <console AS ADMINISTRATOR dump>
> C:\hg\adodbapi>ipy setup.py install
>
> C:\hg\adodbapi>"c:\program files\IronPython 2.7\ipy.exe" setup.py install
>
> adodbapi version="2.4.0.2"
> running install
> running build
> running build_py
> copying adodbapi.py -> build\lib\adodbapi
> copying ado_consts.py -> build\lib\adodbapi
> copying __init__.py -> build\lib\adodbapi
> warning: build_py: byte-compiling is disabled, skipping.
>
> running install_lib
> warning: install_lib: byte-compiling is disabled, skipping.
>
> running install_egg_info
> Removing c:\program files\IronPython 
> 2.7\Lib\site-packages\adodbapi-2.4.0.2-py2.
> 7.egg-info
> Writing c:\program files\IronPython 
> 2.7\Lib\site-packages\adodbapi-2.4.0.2-py2.7
> .egg-info
>
> C:\hg\adodbapi>home
>
> C:\hg\adodbapi>C:
>
> C:\hg\adodbapi>cd \Users\vernon
> C:\Users\vernon>ipy
>
> C:\Users\vernon>"c:\program files\IronPython 2.7\ipy.exe"
> IronPython 2.7 Beta 2 (2.7.0.20) on .NET 4.0.30319.1
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import adodbapi
> >>> adodbapi.version
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> AttributeError: 'module' object has no attribute 'version'
> </console>
> ................. Where did the attribute go??????????????
>
> Now I hand copy the adodbapi folder from IronPython 2.7 site-packages 
> into IronPython 2.6 site packages (because 2.6 distutils will not 
> work) and continue with the same admin console...
> <console dump continues>
> >>> exit()
>
> C:\Users\vernon>ipy26
>
> C:\Users\vernon>"c:\program files\Ironpython 2.6\ipy.exe"
> IronPython 2.6.1 (2.6.10920.0) on .NET 2.0.50727.4206
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import adodbapi
> >>> adodbapi.version
> 'adodbapi v2.4.0.2'
> </console>
> ........................ so it seems to me that "import" is badly 
> broken.  I am unable to test adodbapi.
>
> The code I am testing is at:
> hg clone 
> http://adodbapi.hg.sourceforge.net:8000/hgroot/adodbapi/adodbapi#main
>
> Is there anything I should do?
> --
> Vernon
>
>
> _______________________________________________
> Users mailing list
> Users 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/20110210/0c54c034/attachment.html>


More information about the Ironpython-users mailing list