pip install numpy fails in Python 3; partly fixable in numpy, but there are issues on pip's end as well #325

embray opened this Issue Jul 25, 2011 · 1 comment


None yet
2 participants

embray commented Jul 25, 2011

For several weeks now there's been an issue open for numpy that it can't be pip installed in Python 3: http://projects.scipy.org/numpy/ticket/1857 (the original ticket specifies that this happens when installing in a virtualenv, but I think it applies to a normal site install too).

To summarize: numpy does some slightly unusual (but probably necessary) things for its Python 3 build, that leads to some incompatibility with pip. In particular, when pip runs the egg_info command it messes with the setup.py module's __file__ in ways that numpy doesn't expect. I added a patch to numpy's setup.py that works around that particular issue fine, but there's another problem:

When numpy's setup.py is run, even with the egg_info command, it runs some gcc calls to test for availability of certain features. Some of these can cause error messages from gcc that contain non-ASCII characters. Normally this is not a problem, but since pip is calling the setup.py with subprocess.Popen, it replaces stdout with an ASCII-only pipe (which is a bug in Python: http://bugs.python.org/issue6135). This leads to a UnicodeError from pip.

I'm not sure what the workaround is for issue6135, but it should probably be addressed on pip's end.


This comment has been minimized.

Show comment
Hide comment

carljm Dec 12, 2011


Closing this as dupe of #326, since more discussion has happened there. Thanks for the report!


carljm commented Dec 12, 2011

Closing this as dupe of #326, since more discussion has happened there. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment