Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.
This repository was 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

Description

@rwbarton

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?

Activity

  1. ddfisher commented on Jun 30, 2016

    @ddfisher
    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions