简体   繁体   English

按下TAB上的Python3.6.2 shell将插入制表符而不是自动完成。 如何解决?

[英]Python3.6.2 shell on TAB pressed inserts tab character instead of autocomplete. How to fix it?

I've installed python 3.6.2 from source on Linux Mint 17. Also I've python 3.4.3 with OS installation. 我已经在Linux Mint 17上从源代码安装了python 3.6.2。另外,我已经在OS安装中安装了python 3.4.3。 Just noticed that autocompete on TAB in interactive shell works only in 3.4.3. 刚刚注意到,交互式shell中的TAB上的自动竞争仅在3.4.3中有效。 In 3.6.2 it just inserts tab character. 在3.6.2中,它仅插入制表符。

Any solutions? 有什么办法吗?

Autocomplete and navigating history in python shell uses readline library (and module). python shell中的自动完成和导航历史记录使用readline库(和模块)。 You can check its availability by import readline . 您可以通过import readline检查其可用性。

  1. Install readline-dev library by sudo apt-get install libreadline-dev 通过sudo apt-get install libreadline-dev安装readline-dev库sudo apt-get install libreadline-dev
  2. Recompile python 重新编译python

Appreciation for @user2357112 ! 感谢@ user2357112!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM