Setting up Python notebooks locally for Machine Learning
While there are many options for hosting python notebooks
for free remotely, but I prefer to do things locally. If you wish to do
the same then please read on. Note that I did home some problems
installing skikit-image on a new Apple with M1 silicon, but after
upgrading the latest version of the operating system and doing and
updating my homebrew setup everything works. Note that these
instructions are for using pip. If you are using an alternative
package manager such as Anaconda then you are on your own. I know
nothing about setting up Python on a windows machine.
Setting up the Virtual Environment
First it is better set up a virtual environment (see Creating and Using Virtual Environments in Python . In a suitable place on your machine do:
Note that you might be prompted to upgrade pip. If you are, then
follow the instructions. You are only upgrading the version in your
local virtual environment.
Installing the relevant packages
When you prompt changes to (env) you are inside your virtual
environment. You can now use pip to install packages. For reasons
that I’m not going to explain your life is made a little easier if you
install wheel
You can now install various useful packages for machine learning
This might take a while. The package jupyter drives the
notebooks, so install that
Emacs key bindings
I have been using the editor
Emacs for over 30 years. The
key binding are hardwired into my brain. If you are like me then
installing the jupyter-emacskeys package will make your life a
little less frustrating.
Launching notebooks
You talk to Python notebooks using the web browser when you are running them locally you start your own little server
If you have thing configured then a web browser might open up. If not then look at the output on the terminal and you will see something like:
So in this case you can point your browser at
http://127.0.0.1:8888/?token=83e4ad6deece18a89f8c244f28bb3268d115a4a047764f36
and you are ready to go.