2

I cannot import datashader:

  • in Jupyter Notebook I simply get:

    ImportError: No module named 'datashader'

  • in terminal (linux ubuntu 17.04 32bit), after running python, I get:


user1@user1-Satellite-A110:~$ python
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:10) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import datashader
/home/user1/miniconda3/lib/python3.6/site-packages/odo/backends/pandas.py:94: FutureWarning: pandas.tslib is deprecated and will be removed in a future version.
You can access NaTType as type(pandas.NaT)
  @convert.register((pd.Timestamp, pd.Timedelta), (pd.tslib.NaTType, type(None)))
>>> 

I have installed datashader using miniconda. So first installed miniconda, then used

conda install -c bokeh datashader

Any idea why datashader is not imported?

MCG Code
  • 1,333
  • 5
  • 16
  • 24
  • I had the same error messged. But I solved my problem by adding "sudo" before the pip install command. Not sure whether it works for you, too – Code42 Jan 31 '21 at 17:32

1 Answers1

1

Jupyter notebook is probably just using a different Python installation than the one where you installed datashader. If so, just select the kernel corresponding to where datashader was installed, or install datashader for the kernel Jupyter is using.

In the terminal it looks to me like datashader imported successfully; that's just a warning.

James A. Bednar
  • 3,195
  • 1
  • 9
  • 13
  • could you please show me how to do both: select the kernel corresponding to where datashader was installed, install datashader for the kernel Jupyter is using. – MCG Code Jun 08 '17 at 11:15
  • In the Jupyter Notebook "Kernel" menu, you can select "Change kernel", and you should be able to select the one corresponding to where you have datashader installed (though for me, sometimes this list has only one item, and other times it shows all available environments; not sure what controls that). Once you're in Jupyter, you can find out which kernel you're using by doing something like: "import os ; os.__file__", resulting in '/Users/jbednar/anaconda/envs/ds/lib/python3.6/os.py' (which shows I'm using the environment "ds"). – James A. Bednar Jun 09 '17 at 13:07