0

The arrow keys don't work on my server, but only when running python from the virtualenv (see example below, where I press the left and right keys).

I went over the answers in here: Seeing escape characters when pressing the arrow keys in python shell: I don't have the readline module installed in either version of python, nor does PYTHONSTARTUP point to anywhere.

Any ideas?

$ python3
Python 3.5.2 (default, Oct  8 2019, 13:06:37)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
$ 
$ source venv/bin/activate
$ 
$ python
Python 3.8.2 (default, Mar  8 2020, 12:31:24)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> ^[[D^[[C
Hetzroni
  • 2,109
  • 1
  • 14
  • 29
  • what does `import readline` reports? – Günther Jena Jun 29 '20 at 13:16
  • `ModuleNotFoundError: No module named 'readline'` – Hetzroni Jun 30 '20 at 12:03
  • Are you using `python3 -m venv venv` to create the venv? Try adding the `--system-site-packages` to add symlinks to the system packages – Günther Jena Jun 30 '20 at 12:10
  • Unfortunately that doesn't fix the problem. I ran `python3.8 -mvenv --system-site-packages tempvenv && source tempvenv/bin/activate && python`, but still the arrows don't work properly – Hetzroni Jul 01 '20 at 21:03
  • Is `readline` in the packages? When `import readline` gives `ModuleNotFoundError` it seems to be missing. Did you already try the solution of the thread you linked to just `. venv/bin/activate && python -m pip install readline`? – karlsebal Aug 19 '20 at 07:09

0 Answers0