This project has moved. For the latest updates, please go here.

installing packages into IronPython fails

Sep 24, 2013 at 7:05 PM
using PTVS 2.0 RC in VS2012 with IronPython 2.7.4

Installing any Python Package fails (see full error below) AttributeError: 'module' object has no attribute 'getframe'

You can install setuptools from the command line by adding X:Frames parameter

Is there a way to add the X:Frames parameter to the environment definition?

Installing 'pip' package manager.
Downloading setuptools from
Installing from setuptools-0.9.8
Traceback (most recent call last):
File "", line 17, in <module>
File "<string>", line 8, in <module>
File "c:\users\anyone\appdata\local\temp\ptvs-s6ema-setuptools\setuptools-0.9.8\setuptools__init
.py", line 2, in <module>
File "c:\users\anyone\appdata\local\temp\ptvs-_s6ema-setuptools\setuptools-0.9.8\setuptools\", line 5, in <module>
File "c:\users\anyone\appdata\local\temp\ptvs-_s6ema-setuptools\setuptools-0.9.8\setuptools\", line 10, in <module>
File "c:\users\anyone\appdata\local\temp\ptvs-_s6ema-setuptools\setuptools-0.9.8\setuptools\", line 47, in <module>
File "c:\users\anyone\appdata\local\temp\ptvs-s6ema-setuptools\setuptools-0.9.8\setuptools\", line 38, in exec
AttributeError: 'module' object has no attribute '_getframe'Traceback (most recent call last):
File "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.0\", line 61, in <module>
File "C:\Program Files (x86)\IronPython 2.7\Lib\", line 512, in check_call
subprocess.CalledProcessError: Command '['C:\Program Files (x86)\IronPython 2.7\ipy.exe', '', 'install']' returned non-zero exit status 1
'pip' failed to install. Exit code: 1
Installing 'pyodbc'
Unhandled exception:
Traceback (most recent call last):
File "C:\Program Files (x86)\IronPython 2.7\Lib\", line 170, in run_module
File "C:\Program Files (x86)\IronPython 2.7\Lib\", line 103, in _get_module_details
ImportError: No module named pip
'pyodbc' failed to install. Exit code: 1
Sep 24, 2013 at 7:11 PM
Unfortunately, setuptools & pip do not support IronPython. Using -X:Frames will get you that much further, but it still won't work.

If you're trying to run an existing Python app, I would strongly recommend to use stock CPython or a distro based on that. If you are writing your own IronPython code and need to connect to a database, consider using classes from System.Data directly.
Sep 24, 2013 at 7:58 PM
Frustratingly, setuptools doesn't actually require _getframe. It has a dependency on six, which uses it to define a function that is never used in setuptools. I've manually removed the code from six and setuptools/easy_install work okay.

pip is a long way from working correctly on IronPython, unfortunately, as are many install scripts. The .NET libraries are always worth considering.