2

My Mac updated recently and I noticed that readline functionality was missing in Python. I tried to reinstall it and got a cryptic error, which I cannot decode. I have already uninstalled and reinstalled XCode, and am at a loss.

The installation is a simple: pip install readline

and (part of) the error is:

 Beginning configuration for readline-6.2 for i386-apple-darwin20.6.0
      
      checking whether make sets $(MAKE)... yes
      checking for gcc... gcc
      checking for C compiler default output file name...
      configure: error: in `/private/var/folders/gv/vxf1pd9x3mxc320ld73kkjfw0000gp/T/pip-install-eih2gt76/readline_fb5900c159cc42958f966f55a49321bf/rl/readline-lib':
      configure: error: C compiler cannot create executables
      See `config.log' for more details.

...

      5 warnings generated.
      creating build/lib.macosx-10.9-x86_64-cpython-38
      gcc -bundle -undefined dynamic_lookup -L/Users/david/opt/miniconda3/lib -L/Users/david/opt/miniconda3/lib build/temp.macosx-10.9-x86_64-cpython-38/Modules/3.x/readline.o readline/libreadline.a readline/libhistory.a -lncurses -o build/lib.macosx-10.9-x86_64-cpython-38/readline.cpython-38-darwin.so -arch i386 -arch x86_64
      clang: error: no such file or directory: 'readline/libreadline.a'
      clang: error: no such file or directory: 'readline/libhistory.a'
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> readline

2 Answers2

1

I ended up installing gnureadline instead. See here for more details: https://pypi.org/project/readline/.

malana
  • 5,045
  • 3
  • 28
  • 41
0

The answer for me was reinstalling a package called ncurses, which had become corrupt. Hopefully this helps someone else.