As part of Lesson 4 of the ML course, I’m trying to import the pdpbox and plotnine packages into my Jupyter notebook on Crestle. However, I ended up with the following error:
ModuleNotFoundError: No module named 'pdpbox'
I have already pip-installed the pdpbox and plotnine packages into my Crestle machine. As for environments, I think Crestle only starts off with one environment to begin with. I’m a complete noob when it comes to CLI/bash commands so if someone can guide me through what needs to be done, that would be very helpful!
it’s possible you have different versions of python installed and you pip installed pdpbox for some different version.
An empirical set of steps I follow in such cases are :-
Make sure you have the right kernel selected on your jupyter notebook (mostly the conda env you created before starting out, its always suggested to create a separate new conda env)
Type in !pip list or !conda list (as stated above) if the package is actually installed or not in the path available for our current notebook, in your case it shall not be present here because you can not import it.
Make sure the sys.path on python has included the path to where your conda/pip packages are installed, if not, try to install the package in some of the included path or add a new path reference
Worst case, I simply make a new conda env and start from the beginning.
Ok, sounds like the system can’t find your conda installation. If you run !echo $PATH or !echo {$PATH}, can you type out what it says. Ideally there should be a link to Anaconda in there.
Aha, no link to Anaconda. So just to check. When you run start your jupyter notebook server with “jupyter notebook” command. Did you run something like “source activate fastai” or “source activate fastai-cpu” before.
Typing in “source activate fastai” allows me to switch to using a different anaconda environment. Each environment can have different packages installed and I have one for fastai that I activate before running a jupyter notebook server.
If after trying that does not work, then maybe Anaconda is not installed correctly and so you might have to start again.
i tried first with installing pip install pdpbox: did not work. same error
’ModuleNotFoundError: No module named 'pdpbox'
again i tried with pip3 install pdpbox : it worked. can you please try using pip3…
note that you don’t have to close your current session for this, just open up a new anaconda prompt, and once it’s installed, do the import again, and it should work
I couldn’t find package with !pip list . So, I did following to resolve the issue. Hope following helps.
It seems like this is a Python path issue where your packages are being installed. Just try to install packages within your notebook with !pip install pdpbox and this worked for me.