Q: import in jupyter notebook to use a method from another file I am using jupyter notebook. I have 3 jupyter source files written in python in a folder in the same directory: parser, preprocess, and temp. I am trying to import parser and import preprocess in the temp file so that I can use the methods written in those files.
Example: there is method named extract in parser file. I want to use that from temp file. How can I do that?

A: You can use pip for installing packages. Open command propmpt (cmd) and type this below command
pip install preprocess


A: The easiest way is to change the files you need to import as py files. As an example, parser.ipynb can be converted to a python file parser.py, and you can import it from another notebook file. If you want to use a function named extract() from parser.py, just import
from parser import extract


A: You can run pip install preprocess from the terminal (or CMD, if you are using Windows). Alternatively, you can run ! pip install preprocess from Jupyter Notebook itself, which will do the same thing. You may need the second one if you are working on Google Colab.
