How to change the default browser used by jupyter notebook in windows

Thanks to @Darthbith and this post How to change the default browser used by the ipython/jupyter notebook in Linux? I was able to figure it out: Step 1: To open Anaconda Prompt from the Start Menu and type # for old notebook and JupyterLab < 3.0, or jupyter notebook –generate-config # for new nbclassic and … Read more

“ImportError: No module named” when trying to run Python script

This issue arises due to the ways in which the command line IPython interpreter uses your current path vs. the way a separate process does (be it an IPython notebook, external process, etc). IPython will look for modules to import that are not only found in your sys.path, but also on your current working directory. … Read more

Running Jupyter with multiple Python and IPython paths

This is fairly straightforward to fix, but it involves understanding three different concepts: How Unix/Linux/OSX use $PATH to find executables (%PATH% in Windows) How Python installs and finds packages How Jupyter knows what Python to use For the sake of completeness, I’ll try to do a quick ELI5 on each of these, so you’ll know … Read more

How to load/edit/run/save text files (.py) into an IPython notebook cell?

EDIT: Starting from IPython 3 (now Jupyter project), the notebook has a text editor that can be used as a more convenient alternative to load/edit/save text files. A text file can be loaded in a notebook cell with the magic command %load. If you execute a cell containing: %load filename.py the content of filename.py will … Read more

How do I set custom CSS for my IPython/IHaskell/Jupyter Notebook?

To add custom CSS to a particular notebook you can use HTML. Add and execute a regular Python code cell with the following content: from IPython.core.display import HTML HTML(“”” <style> // add your CSS styling here </style> “””) Alternatively (thanks @abalter) use the %%html cell magic: %%html <style> // add your CSS styling here </style>

How to use Jupyter notebooks in a conda environment?

Disclaimer: ATM tested only in Ubuntu and Windows (see comments to this answer). Jupyter runs the user’s code in a separate process called kernel. The kernel can be a different Python installation (in a different conda environment or virtualenv or Python 2 instead of Python 3) or even an interpreter for a different language (e.g. … Read more

Configuring Spark to work with Jupyter Notebook and Anaconda

Well, it really gives me pain to see how crappy hacks, like setting PYSPARK_DRIVER_PYTHON=jupyter, have been promoted to “solutions” and tend now to become standard practices, despite the fact that they evidently lead to ugly outcomes, like typing pyspark and ending up with a Jupyter notebook instead of a PySpark shell, plus yet-unseen problems lurking … Read more

Change IPython/Jupyter notebook working directory

jupyter notebook –help-all could be of help: –notebook-dir=<Unicode> (NotebookManager.notebook_dir) Default: u’/Users/me/ipynbs’ The directory to use for notebooks. For example: jupyter notebook –notebook-dir=/Users/yourname/folder1/folder2/ You can of course set it in your profiles if needed, you might need to escape backslash in Windows. Note that this will override whatever path you might have set in a jupyter_notebook_config.py … Read more

In which conda environment is Jupyter executing?

As mentioned in the comments, conda support for jupyter notebooks is needed to switch kernels. Seems like this support is now available through conda itself (rather than relying on pip). http://docs.continuum.io/anaconda/user-guide/tasks/use-jupyter-notebook-extensions/ conda install nb_conda which brings three other handy extensions in addition to Notebook Conda Kernels.