1

I am trying to use the module datefinder inside Jupyter Notebook. After activating a virtual environment inside the terminal, I installed this module using the following command: conda install -c conda-forge datefinder. When I try to import this module inside Jupyter notebook using from datefinder import find_dates I see this error

ModuleNotFoundError: No module named 'datefinder'

In the terminal (using Python 3.9.6), I can import the module datefinder but not inside the Jupyter Notebook (using Python 3.7.6). After that I also used pip install datefinder inside the Jupyter Notebook to install datefinder. After successfully installing datefinder, when I again tried to import this module, I still saw the same error ModuleNotFoundError: No module named 'datefinder'. The same problem persisted, I could use the module inside terminal and not inside the notebook.

I faced similar problem when installing opencv using conda and troubleshooted this by adding kernel manually as described in this page https://www.programmersought.com/article/97466914065/ . I have also tried by changing the default kernel to the kernel I created manually and then tried to import this module and still I saw the same error.

shammun
  • 177
  • 2
  • 3
  • 14

1 Answers1

2

Perform the installation on the jupyter notebook as shown below:

pip install datefinder

enter image description here

for more go to Github

Salio
  • 1,058
  • 10
  • 21
  • I used pip to install datefinder before posting this question and still saw the same error. – shammun Jul 29 '21 at 15:52
  • @shammun What error does it send during installation? – Salio Jul 29 '21 at 16:10
  • It doesn't show any error during the installation. But when I try to import the module after the installation is completed, the ModuleNotFoundError is shown again. – shammun Jul 30 '21 at 06:11
  • you may need to restart the `kernel` to use updated packages – Salio Jul 30 '21 at 06:26
  • Tried before but doesn't help either. – shammun Jul 30 '21 at 06:28
  • 1
    `import sys !{sys.executable} -m pip install --user datefinder` for more read http://jakevdp.github.io/blog/2017/12/05/installing-python-packages-from-jupyter/ – Salio Jul 30 '21 at 06:54