How can I choose ipython/jupyter as the DEFAULT python terminal? I use both a windows 10 and a linux machine with the anaconda distribution.
If I type "ipython" on the terminal, it opens an ipython session. If I run the debugger or shift+enter a line, it automatically runs on a "barebones" python shell. Should be simple...but I have been googling and messing with the settings for half an hour with no success.
Looked up
https://code.visualstudio.com/docs/python/tutorial-flask
Use IPython REPL in VS Code
but could not find a way to set it up on my linux or win10 machines. Any ideas?
To do so, open the Command Palette (Ctrl+Shift+P) and enter Preferences: Open User Settings. Then set python.condaPath , which is in the Python extension section of User Settings, with the appropriate path.
Type Ipython inside the terminal window. Then select the line or lines you want to run from the editor window and then click on the Terminal menu at the top of VScode window. One option in the Terminal menu is to "Run Selected Text". This will be run in the Ipython terminal window.
A slightly neater way to achieve @TwoUnderscorez's answer is to just launch the module with -m IPython
:
"python.terminal.launchArgs": [
"-m",
"IPython"
]
Edit: For anyone struggling with IndentationError: unexpected indent
errors, try the following:
"python.terminal.launchArgs": [
"-m",
"IPython",
"--no-autoindent",
]
(wouldn't have just added a comment to the existing answer, but not enough rep)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With