Python Prompt Out Out of Order

262
Shun Liang

Моя установка Python идет с Macports на OS X 10.10.4. После обновления Python до 2.7.10 с Macports оболочка Python теперь выводит строку приглашения «>>>» перед выводом одного оператора:

$ python Python 2.7.10 (default, Aug 26 2015, 18:17:29) [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.56)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> print "test" >>> test print "foo" >>> foo 

Хотя выходные данные тех же операторов выглядят так на виртуальной машине Ubuntu с Python 2.7.6:

vagrant@vagrant-ubuntu-trusty-64:~$ python Python 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> print "test" test >>> print "foo" foo >>> 

Есть ли способ исправить проблему, вышедшую из строя?

3

1 ответ на вопрос

2
fd0

Install the python variant with readline. I'm assuming you are building from source then

sudo port -v install python27 +readline 

There is a known issue with compiling python with libedit which hasn't been fixed yet.