Best practices for turning jupyter notebooks into python scripts

Life saver: as you’re writing your notebooks, incrementally refactor your code into functions, writing some minimal assert tests and docstrings. After that, refactoring from notebook to script is natural. Not only that, but it makes your life easier when writing long notebooks, even if you have no plans to turn them into anything else. Basic … Read more

Jupyter notebook never finishes processing using multiprocessing (Python 3)

It seems that the problem in Jupyter notebook as in different ide is the design feature. Therefore, we have to write the function (prime_factor) into a different file and import the module. Furthermore, we have to take care of the adjustments. For example, in my case, I have coded the function into a file known … Read more

How do I delete/refresh available kernels for IPython/Jupyter notebook v4.0?

After a brute force search, Jupyter stores kernel info for OS X in /Users/${USER}/Library/Jupyter/kernels. This list got copied across from my .ipython/kernels list hence renaming it made no difference. Removing /Users/${USER}/Library/Jupyter/kernels fixes the issue. This is the reference I was looking for: http://jupyter-client.readthedocs.org/en/latest/kernels.html#kernelspecs

Exposing python jupyter on LAN

Try jupyter notebook –ip <your_LAN_ip> –port 8888 Then visit http://your_LAN_ip:8888 from another computer. It’s recommended that you use a password when accessing your notebook server. To set up a password, just run jupyter notebook password. To make it even more secure, you can use SSL for your server by passing the arguments –certfile and –keyfile … Read more

Changing the default port for iPython notebook server / Jupyter

jupyter notebook –ip=0.0.0.0 –port=80 or ipython notebook –ip=0.0.0.0 –port=80 is what i did to run ipython in my vagrant box. (Opened up the ports on the vagrant box to access it on my host mac) usage: ipython [-h] [–certfile NOTEBOOKAPP.CERTFILE] [–ip NOTEBOOKAPP.IP] [–pylab [NOTEBOOKAPP.PYLAB]] [–log-level NOTEBOOKAPP.LOG_LEVEL] [–port-retries NOTEBOOKAPP.PORT_RETRIES] [–notebook-dir NOTEBOOKAPP.NOTEBOOK_DIR] [–config NOTEBOOKAPP.CONFIG_FILE] [–keyfile NOTEBOOKAPP.KEYFILE] [–port … Read more

AttributeError: type object ‘Callable’ has no attribute ‘_abc_registry’

Try uninstalling typing: pip uninstall typing or downgrading python to 3.6. There seems to be a problem with typing in 3.7 If after that you get: AttributeError: module ‘typing’ has no attribute ‘_ClassVar’ try pip uninstall dataclasses. For more info refer to: https://github.com/RTIInternational/gobbli/issues/10

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