I am completely new to programming in general and I do not understand very much about computers. A very similar question was asked previously, however I do not understand anything what was said.
Background: I am attempting to run the first line of code as described in the book Machine Learning with Python for Everyone by Mark Fenner on the Jupyter browser notebook.
This is the code:
In [1]:
from mlwpy import*
%matplotlib inline
Running the code returns this error:
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-3489a3655c97> in <module>
----> 1 from mlwpy import *
2 get_ipython().run_line_magic('matplotlib', 'inline')
ModuleNotFoundError: No module named 'mlwpy'
From my understanding we need a module mlwpy.py and this module can be found at this link thanks to the author of the book here; https://github.com/mfenner1/mlwpy_code/blob/master/mlwpy.py
However, I do not understand what exactly I am supposed to do with this information. Someone mentioned putting the file in the same directory as our Jupyter notebook.
This is where I am confused, what does that mean exactly? I copied and pasted the text onto Jupyter and then saved it as mlwpy.ipynb in the binder, however the problem continues to remain the same.
If someone could explain step by step what I need to do, that would be greatly appreciated.
mlwpy
is not a Python's built-in library, nor an external library you can install with pip
or conda
. It is a custom python file you would like to import.
To run from mlwpy import *
, you need to have a python script named mlwpy.py
in the same directory as your Jupyter notebook file.
So download raw.githubusercontent.com/mfenner1/mlwpy_code/master/mlwpy.py and put it in the same directory as your Jupyter notebook. The downloaded file should be named as mlwpy.py.