Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

Error when trying to install with Python 2 pip is really bad #7

Closed
rwbarton opened this issue Jun 26, 2016 · 1 comment
Closed

Error when trying to install with Python 2 pip is really bad #7

rwbarton opened this issue Jun 26, 2016 · 1 comment

Comments

@rwbarton
Copy link

I accidentally ran pip install typed_ast using Python 2 and got these errors:

[many more errors from gcc skipped]

ast27/Parser/tokenizer.c:512:45: error: ‘PyId_readline’ undeclared (first use in this function)

     readline = _PyObject_GetAttrId(stream, &PyId_readline);

                                             ^

error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-uAt4J4/typed-ast/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-oRixWl-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-uAt4J4/typed-ast
Traceback (most recent call last):
  File "/usr/bin/pip", line 9, in <module>
    load_entry_point('pip==1.5.6', 'console_scripts', 'pip')()
  File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 248, in main
    return command.main(cmd_args)
  File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 161, in main
    text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 41: ordinal not in range(128)

Surely the terrible final error message is not typed_ast's fault, but can the package just be marked as Python 3-only on PyPI somehow?

@ddfisher
Copy link
Collaborator

It doesn't look like that's possible as far as I can tell, but I can check the Python version at the top of setup.py and give a better error, at least.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants