0

I am trying to stop execution of Python scripts in IPython in Windows. I have installed Python and IPython using Anaconda. However, whenever I press Ctrl+C, it breaks out of the current Python script as well as IPython. I saw a similar post here, which said to instead launch IPython with python C:\python27\scripts\ipython-script.py (or wherever that .py script is located), but for Anaconda users that script is in C:\Users\andre\Anaconda3\pkgs\ipython-5.1.0-py35_0\Scripts\ipython-script.py (which then changes with every version number if IPython that is installed). This ends up working but is certainly not convenient. I can make a quick shortcut/keybinding that runs that ipython-script.py script, but if and when I update IPython, I'm going to have to change the shortcut, and that seems rather inconvenient.

Any suggestions? I suppose I could add C:\Users\andre\Anaconda3\pkgs to my path, but that seems a little bit of overkill since there are a ton of packages in there.

Community
  • 1
  • 1
Argon
  • 405
  • 1
  • 6
  • 18
  • You should not launch packages from that directory. Instead, prefer `C:\users\andre\Anaconda3\Scripts` or `C:\users\andre\Anaconda3\envs\\Scripts`. That way, it won't change with each version. – darthbith Aug 19 '16 at 01:40
  • @darthbith Thank you! That solves it. I searched for `ipython-script.py`, but the directory in my original post was the only one that came up even though it's also in the `C:\users\andre\Anaconda3\Scripts` directory you mentioned. – Argon Aug 19 '16 at 01:44
  • OK that's good. FWIW, I don't have this problem, so it might be worth investigating why this is cropping up, rather than calling the IPython script directly – darthbith Aug 19 '16 at 01:48
  • Yeah, I just tried running the IPython script directly and still run into the same issue. I'm not entirely sure why. I'm going to look into that some more. I'll post back here if I find anything. – Argon Aug 19 '16 at 01:49
  • You could try installing it into a new environment and see if the behavior remains: `conda create -n ipytest ipython`, then `activate ipytest` then `ipython` – darthbith Aug 19 '16 at 01:56

0 Answers0