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 https://go.microsoft.com/fwlink/?LinkId=317603
Installing from setuptools-0.9.8
Traceback (most recent call last):
File "setup.py", 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\extension.py", line 5, in <module>
File "c:\users\anyone\appdata\local\temp\ptvs-_s6ema-setuptools\setuptools-0.9.8\setuptools\dist.py", line 10, in <module>
File "c:\users\anyone\appdata\local\temp\ptvs-_s6ema-setuptools\setuptools-0.9.8\setuptools\compat.py", line 47, in <module>
File "c:\users\anyone\appdata\local\temp\ptvs-s6ema-setuptools\setuptools-0.9.8\setuptools\compat.py", 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\pip_downloader.py", line 61, in <module>
File "C:\Program Files (x86)\IronPython 2.7\Lib\subprocess.py", line 512, in check_call
subprocess.CalledProcessError: Command '['C:\Program Files (x86)\IronPython 2.7\ipy.exe', 'setup.py', '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\runpy.py", line 170, in run_module
File "C:\Program Files (x86)\IronPython 2.7\Lib\runpy.py", line 103, in _get_module_details
ImportError: No module named pip
'pyodbc' failed to install. Exit code: 1
Coordinator
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.
Coordinator
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 setup.py install scripts. The .NET libraries are always worth considering.