Git 2.5.1's bash console doesn't open python interpreter

后端 未结 8 1781
小鲜肉
小鲜肉 2021-01-31 08:56

If I do it in CMD, it works without issues, but if I try it in Git Bash it doesn\'t work. I like to use Git Bash as my only console, but I can\'t do that if it doesn\'t work wit

8条回答
  •  野性不改
    2021-01-31 09:52

    Building onto @Darthfett's answer. I had to make sure there were quote marks and not reference the .exe files

    So in the end in your .bashrc

    alias python='winpty python' alias pip='winpty pip' # Rescue pip as well

    Then is all works

    Python

    Tawanda@Tawanda-PC MINGW64 ~
    $ alias python='winpty python'
    
    Tawanda@Tawanda-PC MINGW64 ~
    $ python
    Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> exit()
    

    Pip

    Tawanda@Tawanda-PC MINGW64 ~
    $ alias pip='winpty pip'
    
    Tawanda@Tawanda-PC MINGW64 ~
    $ pip -v
    
    Usage:
      pip  [options]
    
    Commands:
      install                     Install packages.
      download                    Download packages.
      uninstall                   Uninstall packages.
      freeze                      Output installed packages in requirements format.
      list                        List installed packages.
      show                        Show information about installed packages.
    

提交回复
热议问题