python multiprocessing in Jupyter on Windows: AttributeError: Can’t get attribute “abc”

I got multiprocessing to work from within a Jupyter notebook on Windows by saving my function in a separate .py file and including that file in my notebook. Example: f.py: def f(name, output): output.put(‘hello {0}’.format(name)) return Code in Jupyter notebook: from multiprocessing import Process, Queue #Having the function definition here results in #AttributeError: Can’t get … Read more

Jupyter Notebooks not displaying progress bars

The answer is in this GitHub issue. The key is to ensure that you have the ipywidgets notebook extension enabled using the following command: jupyter nbextension enable –py widgetsnbextension For the old JupyterLab 2.0 you’ll also need to install the JupyterLab extension: jupyter labextension install @jupyter-widgets/jupyterlab-manager For the old JupyterLab 2.0 installing the JupyterLab extension … Read more

Execute Python script within Jupyter notebook using a specific virtualenv

Here’s what worked for me (non conda python): (MacOS, brew version of python. if you are working with system python, you may (will) need prepend each command with sudo) First activate virtualenv. If starting afresh then, e.g., you could use virtualenvwrapper: $ pip install virtualenvwrapper $ mkvirtualenv -p python2 py2env $ workon py2env # This … Read more

Plotly chart not showing in Jupyter notebook

You need to change init_notebook_mode call and remove connected=True, if you want to work in offline mode. Such that: # Import the necessaries libraries import plotly.offline as pyo import plotly.graph_objs as go # Set notebook mode to work in offline pyo.init_notebook_mode() # Create traces trace0 = go.Scatter( x=[1, 2, 3, 4], y=[10, 15, 13, 17] … Read more