Temporary fix for osx pyenv python not using arrow keys

TL;DR

Since python tries to read libreadline.6.dylib, I put it in a compatible symbolic link with another name.

cd $(brew --prefix readline)/lib
ln -s libreadline.dylib libreadline.6.dylib

environment

Event and history

The arrow keys die in the virtualenv + pyenv python environment that I put in with brew. python There are some arrow keys and history problems.

Try pip install readline and ʻimport readline`

ImportError: dlopen(/usr/local/var/pyenv/versions/3.5.2/lib/python3.5/lib-dynload/readline.cpython-35m-darwin.so, 2): Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
  Referenced from: /usr/local/var/pyenv/versions/3.5.2/lib/python3.5/lib-dynload/readline.cpython-35m-darwin.so
  Reason: image not found

I wonder if there is libreadline.6.dylib

/usr/local/opt/readline/lib


libhistory.7.0.dylib
libhistory.7.dylib@
libhistory.a
libhistory.dylib@
libreadline.7.0.dylib
libreadline.7.dylib@
libreadline.a
libreadline.dylib@

There is no.

It's also a hassle to find and reinsert the hash of fomula when it was readline 6.x. It's not important, and a bandage with a link.

cd $(brew --prefix readline)/lib
ln -s libreadline.dylib libreadline.6.dylib

Solution (looking at the person who is rushing)

Recommended Posts

Temporary fix for osx pyenv python not using arrow keys
Change python version using pyenv
Ansible playbook for setting up Python preferences using pyenv on Mac
Arrow keys do not work in zsh + python shell on mac
Introducing Python using pyenv on Ubuntu 20.04
Notes on installing Python using PyEnv
[TouchDesigner] Tips for for statements using python
Install Python on CentOS using Pyenv
[Python] Reasons for overriding using super ()
[Python] Multiplication table using for statement
Install Python on CentOS using pyenv
Notes for using OpenCV on Windows10 Python 3.8.3.
Python development environment for macOS using venv 2016
[50 counts] Key transmission using Python for Windows
[python, multiprocessing] Behavior for exceptions when using multiprocessing
Tips for using python + caffe with TSUBAME
Notes for using python (pydev) in eclipse