23

I like python in interactive mode when on linux. However on cygwin, the interactive mode doesn't start. I don't see the ">>>" prompt and whatever I enter doesn't result in anything.

Solved: I figured out the problem from the answers below. I was using a windows installation of python and it needs -i option to start in interactive mode.

2
  • What do you get when you start python? I don't have any problems running python 3.1.3 in Cygwin and I don't think I needed to do anything special when I installed it. Jan 12, 2012 at 19:39
  • Also, check to see if your python install dir is in your $path. Jan 12, 2012 at 19:49

3 Answers 3

38

Try passing the -i flag to Python.

I've experienced this very same thing, as have others. There seems to be an issue with cygwin's ability to operate interactively with native-Windows applications (including Python.exe). If you can, install the cygwin version of Python via cygwin's package management, as it doesn't have this interactivity problem.

1
  • It's true, and cygwin's python will handle cygwin pathnames, while the built-in python will not.
    – vy32
    Oct 12, 2018 at 16:38
0

I use it all the time.

$ python
Python ****** (********) 
**********************
Type "help", "copyright", "credits" or "license" for more information.
>>> "It works"
'It works'
>>> 

If you supply a file name, or anything like that, it won't go into interactive mode by default.

1
  • I can't tell if you're using cygwin, but I can confirm that my cygwin python3.7m enters interactive mode the same way.
    – Phil Goetz
    Apr 1, 2020 at 23:13
0

A Windows install of ActiveState python won't enter interactive mode, AND it will be run instead of cygwin Python even if you have cygwin Python installed, because ActiveState python inserts its bin path at the front of your Windows System PATH environment variables.

I solved it by going (in Windows) to Control Panel->System -> Advanced system settings-> Environment variables, choosing PATH, selecting Edit, and cut-pasting all the ActiveState entries from the front to the back of the PATH list.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.