Can't use IPython console in PyCharm - console

I wanted to use ipython as default console in Pycharm but it doesn't work.
I have selected use ipython when available in the console option available under Build,Deployment and Execution in Settings. Did the same in Default Settings also. But it doesn't seem to work.
I am using Python 3.6.3 , IPython 6.2.1 and PyCharm Professional 2017.3

This is probably because IPython is not recognized as a package in your project interpreter.
This usually happens when you configure a virtualenv for your project, but don't check the Inherit global site-packages checkbox.
Fixing is quite easy:
Go to Settings -> Project: <project name> -> Project interpreter
At the bottom of the packages list you should see a + sign.
Press that button, find ipython and install it.
On the next time you'll open your console, IPython will be detected and used automatically.

You have not installed IPython package.
Do this:
              File → Settings... → Project your_project → Python Interpreter
then click the + button on the right-hand vertical toolbar (see the red arrow in the picture):
and from the new popup window select and install ipython package:
Finally, restart your Python Console.

Related

DataSpell: Jupyter server failed to start

I am getting following error while trying to run a jupyter-notebook cell from DataSpell. Can anyone suggest about how to get rid of this?
Thanks in advance.
You just have to set a Python Interpreter for the project.
Preferences -> Python Interpreter (under Project Workspace) -> Select or Add an interpreter
I faced the same issue and finally realized that the problem was the Interpreter misconfiguration.
Download Anaconda.
Install Anaconda using the installation instructions.
Run Anaconda Navigator and in the left hand-side, click on the "Environments" tab.
In this section you can see the existing "Environments" or create a new environment, the default mode is base (root).
Open DataSpell, go to the Interpreter and select the environment you see in number 4.
File | Settings | Project | Python Interpreter for Windows and Linux
DataSpell | Preferences | Project | Python Interpreter for macOS

How to have the autocomplete feature in jupyter notebook like we have in pycharm or visual code?

I just want that autocomplete feature like I have in VC studio and pycharm in jupyter notebook, is there any way folks? I saw in some youtube tutorials people completing the code using the tool, any idea about that?
There is a hinterland functionality that when enabled then auto-complete code works.
For you to access the functionality first install jupyter_contrib_nbextensions as follows:
Install the python package
pip install jupyter_contrib_nbextensions
Then install javascript and css files
jupyter contrib nbextension install --user
More information on how to install can be found here
Then re-start the jupyter notebook. Look for a tab named Nbextensions and click on it. Then look for Hinterland and make sure that it is checkd:
Refresh/Restart jupyter notebook for changes to take place.
You just have to click the "Tab"-Button after typing something (e.g. a Class name followed by a dot). Then you find suggestions that you can insert by using Tab or Enter.

How can I disable the autocomplete function in Jupyter notebook(Tab)

I typed "Summary" outside the cell and change the config of Jupyter notebook.
When I press Tab, the autocomplete menu pop out, but I only want 4 spaces when I press Tab. I Google this question and try something like:
%config IPCompleter.greedy=False
However, I still have the autocomplete menu when I press Tab. How can I disable it?
There is an extension called 'Hinterland' for jupyter, which automatically displays the drop down menu when typing or control when it should appears . There are also some other useful extensions.
In order to install extensions, you can follow the guide on this Github repository . To easily activate extensions, you may want to use the extensions configurator.
To install Hinterland run in a Conda terminal this:
conda install -c conda-forge jupyter_nbextensions_configurator
To enable it :
jupyter nbextension enable hinterland/hinterland

Jupyterlab: turn on tab completion for text editor as in Notebook?

In Jupyterlab, there is a text editor that we can open .py files, is it possible to also turn on tab completion, just like how it works in Notebook ?
By now, tab completion in the text editor of jupyter lab has been implemented in this pull request (see also discussion in this issue). However, for it to be working you need to open a console for the editor (right click in the editor window and select Create Console for Editor).
No, it is currently an open issue. https://github.com/jupyterlab/jupyterlab/issues/1276
The package jupyterlab-lsp now provides tab completion in the text editor. You need can install it from pip or conda, along with a language server for Python:
pip install jupyter-lsp
pip install jedi-language-server
I also needed to enable the server side extension:
jupyter server extension enable --user --py jupyter_lsp
And enabled #krassowski/jupyterlab-lsp and #krassowski/completion-theme via JupyterLab's extension GUI (the puzzle piece on the right hand side). Then I restarted JupyterLab, and completion worked (with Tab). I am not sure if all these steps are neccessary, it might depend on your environment.

what is the ipython notebook "Terminals" menu option

I am running ipython notebook on my OSX machine and/or my ubuntu 14.04 machine. I am using ipython 3.0.0, and ipython (jupyter) notebooks.
When I start an ipython notebook, under New there is a terminal option, but it's unavailable for me.
I haven't been able to find any documentation on this feature, how to activate it or what it does.
The ipython notebook --help command doesn't mention it and I haven't found anything in the documentation either.
I haven't discovered the special keywords to search google for to get any information either.
What does this feature do? How do I activate it? Is there any documentation on this available?
IPython/Jupyter appears to support browser-based interactive terminal sessions. This is enabled on my machine by installing the terminado package with pip or conda. This fixes the "Terminals Unavailable" message on the drop-down, and lets me start up a (bash) terminal session in a new tab.
See this commit:
IPython on GitHub
Here's the code in Lib/site-packages/IPython/html/notebookapp.py responsible for this item (located the file by searching the source for "Terminals" case-sensitively):
def init_terminals(self):
try:
from .terminal import initialize
initialize(self.web_app)
self.web_app.settings['terminals_available'] = True
except ImportError as e:
log = self.log.debug if sys.platform == 'win32' else self.log.warn
log("Terminals not available (error was %s)", e)
As you can see, there should be a message in the console log specifying what went wrong (you may need to increase log verbosity with ipython notebook --log-level=<level> to see it). In my case, it said:
Terminals not available (error was No module named fcntl)
The html.terminal module that is being imported appears to provide a web-based IPython interactive console.
Support for Windows terminals with terminado dependency was added in Jupyter 5.3.0:
https://github.com/jupyter/notebook/pull/3087
Actually it's jupyter notebook 5.3.0, not jupyter. the two versions is not the same thing.
- jupyter --version
- jupyter notebook --version
I ever suffered from this.

Resources