4

I use ipynb-file. When I try to import prophet library I get this:

ModuleNotFoundError: No module named 'prophet'.

But this package is installed and it is in my current environment. Jupyter server's interpreter have prophet library. When I move cursor to name of library, DataSpell shows its info:

screenshot

If I execute from prophet import Prophet in python console everything is OK! I think problem is in Jupyter notebook, but can't find it.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
niqx
  • 41
  • 1
  • 3

3 Answers3

1

Ran into this recently. This answer set me on the right track.

jupyter was also installed in one of my default Ubuntu python environments, and DataSpell was spinning up a server using that binary instead of the one installed in the environment I'd created in DataSpell.

(As a coincidence, that default environment also had common packages like pandas installed, so I didn't run into this till I installed a package in the DataSpell-managed environment that wasn't already in my Ubuntu default python environment.)

  • I found the default jupyter binary: which jupyter.
  • Inspected the script: nano /home/<user>/.local/bin/jupyter
  • Saw the python environment it was installed in: #!/usr/bin/python3.8 at the top of the script
  • Uninstalled jupyter from that environment: python3.8 -m pip uninstall jupyter

And then DataSpell used the correct jupyter binary (and all imports worked fine).

capitalistcuttle
  • 1,709
  • 2
  • 20
  • 28
0

I did SOLVE it in a simpler way using the following steps:

  1. Run your Jupyter Notebook from windows start (I have anaconda).
  2. From Jupyter CMD copy the 2nd link look similar to this: http://127.0.0.2:8890/?token=f1204144....
  3. In Dataspell Go to File->Add Jupyter Connection-> Select "Connect to Jupyter server using URL" and Paste the copied link in step 2. A folder will be appeared after this open your code "notebook" from that folder.

Enjoy!

0

I am assuming you have already installed the package/s beforehand. The next thing to do is to configure the right interpreter. For that you would have to follow the official documentation Set up a working environment .

In my case, I had a working anaconda environment which was working fine on Jupyter Notebook but not in DataSpell, even after the configuration.

Then I tried Files -> Invalidate Caches in IDE's toolbar.

This will remove the internal DataSpell cached files and restart the app and that was enough for me. Everything started working fine after that.

Herbi Shtini
  • 2,002
  • 29
  • 34