Jupyter notebooks in Visual Studio Code does not use the active virtual environment

It’s because there is an extra step needed – you need to explicitly install a Jupyter kernel that points to your new Python virtual environment. You can’t simply activate Jupyter-lab or Notebook from the virtual environment. This has tripped me up before, too. Follow the advice here: Using Jupyter notebooks with a virtual environment And, … Read more

Simple way to visualize a TensorFlow graph in Jupyter?

Here’s a recipe I copied from one of Alex Mordvintsev deep dream notebook at some point from IPython.display import clear_output, Image, display, HTML import numpy as np def strip_consts(graph_def, max_const_size=32): “””Strip large constant values from graph_def.””” strip_def = tf.GraphDef() for n0 in graph_def.node: n = strip_def.node.add() n.MergeFrom(n0) if n.op == ‘Const’: tensor = n.attr[‘value’].tensor size … Read more

How to change the default browser used by the ipython/jupyter notebook in Linux?

You can create jupyter_notebook_config.py by: jupyter notebook –generate-config Then you go to ~/.jupyter/jupyter_notebook_config.py and change # c.NotebookApp.browser=”” to for example: c.NotebookApp.browser=”/usr/bin/google-chrome %s” You can choose which ever browser is installed. You’ll find the path for example by typing which firefox Do not forget to delete the #

Jupyter Notebook authentication token while in Pycharm

Running jupyter notebook list will display all of the running servers on your machine. So doing this in the terminal after starting a cell in PyCharm will result in output similar to Currently running servers: http://127.0.0.1:8888/?token=f85145dda03dc598bbbfa6e53b93cbcb27629ea00cfd2105 :: /home/…. which contains the appropriate token for authenticating.

Link Conda environment with Jupyter Notebook

For Anaconda I suggest you a much easier and proper solution; just give a look at the nb_conda_kernels package. It allows you to “manage your conda environment-based kernels inside the Jupyter Notebook”. Is should be included since Anaconda version 4.1.0, otherwise simply use conda install nb_conda Now you should be able to manage all direcly … Read more

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

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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)