When I'm using Jupyter Notebook under Pycharm, it doesn't seem to include my current working directory, or the source root directory, in the PYTHONPATH
of the currently active Jupyter Notebook. This is unlike the behaviour of ordinary .py
files, for which Pycharm automatically includes its current directory and the project source root directory in the PYTHONPATH
. So, is it possible to set Pycharm to automatically include the project source root directory in the PYTHONPATH
for Jupyter Notebooks run under Pycharm?
Debug code in Jupyter notebooksSet the breakpoints in the selected cell and press Alt + Shift + Enter for Windows or ⌥⇧↩ for macOS. Alternatively, you can right-click the cell and select Debug Cell from the context menu.
PyCharm Pro now has full support for both static and JavaScript-based outputs used by popular scientific libraries such as #Plotly, Bokeh, #Altair, ipywidgets, and more.
It turns out, in a past endeavour, I modified my jupyter_notebook_config.py
in %USER%\.jupyter
folder. Looked at lines as follows:
## The directory to use for notebooks and kernels.
c.NotebookApp.notebook_dir = 'D:\\Works\\GitHub\\Jupyter\\'
The line under the ##
, indicates the override path, evidently.
When I commented it out...Pycharm all of the sudden successfully launched with pwd of the file (location of the .ipynb). good luck, hth.
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