Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install standard Python module into Iron Python?

I'm writing some ETL scripts in Iron Python and have found that I could benefit from using the date parser in module dateutil. I know I can use my standard python library by pointing Iron Python at the appropriate location. My scripts, however, will likely run on a machine with Iron Python but without plain vanilla Python installed.

How can I install dateutil (or other standard Python modules) into my Iron Python library?

I've tried simply copying the .egg from the standard site-packages directory to the Iron Python site-packages directory, but this results in an ImportError when I import dateutil.

like image 530
Larry Lustig Avatar asked Nov 21 '11 18:11

Larry Lustig


1 Answers

IronPython doesn't support eggs (because it doesn't support zipimport), but if you just place the folder containing the .py files in site-packages it should work (as long as it doesn't use a C extension).

Eggs are just zip files, so you may have to rename it to get at the .py files.

like image 71
Jeff Hardy Avatar answered Sep 29 '22 00:09

Jeff Hardy