holoviz / geoviews

Simple, concise geographical visualization in Python
http://geoviews.org
BSD 3-Clause "New" or "Revised" License
596 stars 77 forks source link

Jupyter Notebook: ModuleNotFoundError: No module named 'geoviews' #501

Closed Ludo915 closed 3 years ago

Ludo915 commented 3 years ago

Hello,

After setting up a conda environment in a ubuntu terminal under windows 10 by doing:

conda env create -f environment.yml conda activate covsco pip install hdx-python-api conda install -c pyviz holoviz conda install -c conda-forge geoviews pip install cdsapi pip insall xarray

I am able to import geoviews from ipython but not from jupyter notebook.

What am I doing wrong?

ALL software version info

(this library, plus any other relevant software, e.g. bokeh, python, notebook, OS, browser, etc)

packages in environment at /home/ludo915/anaconda3/envs/covsco:

#

Name Version Build Channel

_libgcc_mutex 0.1 conda_forge conda-forge _openmp_mutex 4.5 1_gnu conda-forge _py-xgboost-mutex 2.0 cpu_0 conda-forge _tflow_select 2.3.0 eigen abseil-cpp 20200923.3 h9c3ff4c_0 conda-forge absl-py 0.12.0 pyhd8ed1ab_0 conda-forge aiohttp 3.7.4 py38h497a2fe_0 conda-forge argon2-cffi 20.1.0 py38h497a2fe_2 conda-forge astor 0.8.1 pyh9f0ad1d_0 conda-forge astunparse 1.6.3 pyhd8ed1ab_0 conda-forge async-timeout 3.0.1 py_1000 conda-forge async_generator 1.10 py_0 conda-forge attrs 20.3.0 pyhd3deb0d_0 conda-forge backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge basicauth 0.4.1 pypi_0 pypi beautifulsoup4 4.9.3 pypi_0 pypi bleach 3.3.0 pyh44b312d_0 conda-forge blinker 1.4 py_1 conda-forge bokeh 2.0.2 py38h32f6830_0 conda-forge boto3 1.17.53 pypi_0 pypi botocore 1.20.53 pypi_0 pypi brotlipy 0.7.0 py38h497a2fe_1001 conda-forge bzip2 1.0.8 h7f98852_4 conda-forge c-ares 1.17.1 h7f98852_1 conda-forge ca-certificates 2020.12.5 ha878542_0 conda-forge cachetools 4.2.1 pyhd8ed1ab_0 conda-forge cartopy 0.18.0 py38hab71064_13 conda-forge cchardet 2.1.7 pypi_0 pypi certifi 2020.12.5 py38h578d9bd_1 conda-forge cffi 1.14.5 py38ha65f79e_0 conda-forge cftime 1.4.1 py38h5c078b8_0 conda-forge chardet 4.0.0 py38h578d9bd_1 conda-forge ckanapi 4.5 pypi_0 pypi click 7.1.2 pyh9f0ad1d_0 conda-forge cloudpickle 1.6.0 py_0 conda-forge colorcet 2.0.6 py_0 pyviz colorlog 5.0.1 pypi_0 pypi cryptography 3.4.7 py38ha5dfef3_0 conda-forge curl 7.76.1 h979ede3_0 conda-forge cycler 0.10.0 py_2 conda-forge cytoolz 0.11.0 py38h497a2fe_3 conda-forge dask 2.17.2 py_0 conda-forge dask-core 2.17.2 py_0 conda-forge datashader 0.11.1 py_0 pyviz datashape 0.5.4 py_1 conda-forge dbus 1.13.18 hb2f20db_0 deap 1.3.1 py38h51da96c_2 conda-forge decorator 5.0.7 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge distributed 2.30.1 py38h578d9bd_0 conda-forge dnspython 2.1.0 pypi_0 pypi docopt 0.6.2 pypi_0 pypi email-validator 1.1.2 pypi_0 pypi entrypoints 0.3 pyhd8ed1ab_1003 conda-forge et-xmlfile 1.0.1 pypi_0 pypi expat 2.3.0 h9c3ff4c_0 conda-forge fastparquet 0.5.0 py38h5c078b8_0 conda-forge fontconfig 2.13.1 hba837de_1005 conda-forge freetype 2.10.4 h0708190_1 conda-forge fsspec 0.9.0 pyhd8ed1ab_2 conda-forge gast 0.3.3 py_0 conda-forge geos 3.9.1 h9c3ff4c_2 conda-forge geoviews 1.5.0 py_0 conda-forge gettext 0.19.8.1 h0b5b191_1005 conda-forge giflib 5.2.1 h36c2ea0_2 conda-forge glib 2.68.1 h9c3ff4c_0 conda-forge glib-tools 2.68.1 h9c3ff4c_0 conda-forge google-auth 1.28.0 pyh44b312d_0 conda-forge google-auth-oauthlib 0.4.1 py_2 conda-forge google-pasta 0.2.0 pyh8c360ce_0 conda-forge greenlet 1.0.0 pypi_0 pypi grpc-cpp 1.36.4 hf89561c_1 conda-forge grpcio 1.36.1 py38hdd6454d_0 conda-forge gst-plugins-base 1.14.0 hbbd80ab_1 gstreamer 1.14.0 h28cd5cc_2 h5py 2.10.0 nompi_py38h9915d05_106 conda-forge hdf4 4.2.13 h10796ff_1005 conda-forge hdf5 1.10.6 nompi_h6a2412b_1114 conda-forge hdx-python-api 5.0.7 pypi_0 pypi hdx-python-country 2.8.3 pypi_0 pypi hdx-python-utilities 2.6.3 pypi_0 pypi heapdict 1.0.1 py_0 conda-forge holoviews 1.13.5 py_0 pyviz holoviz 0.11.6 py_0 pyviz html5lib 1.1 pypi_0 pypi hvplot 0.6.0 py_0 pyviz icu 58.2 hf484d3e_1000 conda-forge idna 2.10 pyh9f0ad1d_0 conda-forge ijson 3.1.4 pypi_0 pypi importlib-metadata 3.10.1 py38h578d9bd_0 conda-forge inflect 5.3.0 pypi_0 pypi ipykernel 5.5.3 py38hd0cf306_0 conda-forge ipython 7.22.0 py38hd0cf306_0 conda-forge ipython_genutils 0.2.0 py_1 conda-forge ipywidgets 7.6.3 pyhd3deb0d_0 conda-forge itsdangerous 1.1.0 pypi_0 pypi jedi 0.18.0 py38h578d9bd_2 conda-forge jinja2 2.11.3 pyh44b312d_0 conda-forge jmespath 0.10.0 pypi_0 pypi joblib 1.0.1 pyhd8ed1ab_0 conda-forge jpeg 9d h36c2ea0_0 conda-forge jsonlines 2.0.0 pypi_0 pypi jsonpath-ng 1.5.2 pypi_0 pypi jsonschema 3.2.0 pyhd8ed1ab_3 conda-forge jupyter 1.0.0 py38h578d9bd_6 conda-forge jupyter_client 6.1.12 pyhd8ed1ab_0 conda-forge jupyter_console 6.4.0 pyhd8ed1ab_0 conda-forge jupyter_core 4.7.1 py38h578d9bd_0 conda-forge jupyterlab_pygments 0.1.2 pyh9f0ad1d_0 conda-forge jupyterlab_widgets 1.0.0 pyhd8ed1ab_1 conda-forge keras-preprocessing 1.1.2 pyhd8ed1ab_0 conda-forge kiwisolver 1.3.1 py38h1fd1430_1 conda-forge krb5 1.17.2 h926e7f8_0 conda-forge lcms2 2.12 hddcbb42_0 conda-forge ld_impl_linux-64 2.35.1 hea4e1c9_2 conda-forge libblas 3.9.0 8_openblas conda-forge libcblas 3.9.0 8_openblas conda-forge libclang 11.1.0 default_ha53f305_0 conda-forge libcurl 7.76.1 hc4aaa36_0 conda-forge libedit 3.1.20191231 he28a2e2_2 conda-forge libev 4.33 h516909a_1 conda-forge libevent 2.1.10 hcdb4288_3 conda-forge libffi 3.3 h58526e2_2 conda-forge libgcc-ng 9.3.0 h2828fa1_19 conda-forge libgfortran-ng 9.3.0 hff62375_19 conda-forge libgfortran5 9.3.0 hff62375_19 conda-forge libglib 2.68.1 h3e27bee_0 conda-forge libgomp 9.3.0 h2828fa1_19 conda-forge libhxl 4.23 pypi_0 pypi libiconv 1.16 h516909a_0 conda-forge liblapack 3.9.0 8_openblas conda-forge libllvm10 10.0.1 he513fc3_3 conda-forge libllvm11 11.1.0 hf817b99_2 conda-forge libnetcdf 4.8.0 nompi_hf7493bd_100 conda-forge libnghttp2 1.43.0 h812cca2_0 conda-forge libopenblas 0.3.12 pthreads_h4812303_1 conda-forge libpng 1.6.37 h21135ba_2 conda-forge libpq 13.1 hfd2b0eb_2 conda-forge libprotobuf 3.15.8 h780b84a_0 conda-forge libsodium 1.0.18 h36c2ea0_1 conda-forge libssh2 1.9.0 ha56f1ee_6 conda-forge libstdcxx-ng 9.3.0 h6de172a_19 conda-forge libtiff 4.2.0 hdc55705_0 conda-forge libuuid 2.32.1 h7f98852_1000 conda-forge libwebp-base 1.2.0 h7f98852_2 conda-forge libxcb 1.13 h7f98852_1003 conda-forge libxgboost 1.3.3 h9c3ff4c_2 conda-forge libxkbcommon 1.0.3 he3ba5ed_0 conda-forge libxml2 2.9.10 hb55368b_3 linear-tsv 1.1.0 pypi_0 pypi llvmlite 0.36.0 py38h4630a5e_0 conda-forge locket 0.2.0 py_2 conda-forge lz4-c 1.9.3 h9c3ff4c_0 conda-forge markdown 3.3.4 pyhd8ed1ab_0 conda-forge markupsafe 1.1.1 py38h497a2fe_3 conda-forge matplotlib 3.1.3 py38_0 matplotlib-base 3.1.3 py38hef1b27d_0 mistune 0.8.4 py38h497a2fe_1003 conda-forge msgpack-python 1.0.2 py38h1fd1430_1 conda-forge multidict 5.1.0 py38h497a2fe_1 conda-forge multipledispatch 0.6.0 py_0 conda-forge mysql-common 8.0.23 ha770c72_1 conda-forge mysql-libs 8.0.23 h935591d_1 conda-forge nbclient 0.5.3 pyhd8ed1ab_0 conda-forge nbconvert 6.0.7 py38h578d9bd_3 conda-forge nbformat 5.1.3 pyhd8ed1ab_0 conda-forge ncurses 6.2 h58526e2_4 conda-forge ndg-httpsclient 0.5.1 pypi_0 pypi nest-asyncio 1.5.1 pyhd8ed1ab_0 conda-forge netcdf4 1.5.6 nompi_py38h5e9db54_101 conda-forge notebook 6.3.0 pyha770c72_1 conda-forge nspr 4.30 h9c3ff4c_0 conda-forge nss 3.64 hb5efdd6_0 conda-forge num2words 0.5.10 pypi_0 pypi numba 0.53.1 py38h0e12cce_0 conda-forge numpy 1.18.1 py38h8854b6b_1 conda-forge oauthlib 3.0.1 py_0 conda-forge olefile 0.46 pyh9f0ad1d_1 conda-forge openjpeg 2.4.0 hf7af979_0 conda-forge openpyxl 3.0.7 pypi_0 pypi openssl 1.1.1k h7f98852_0 conda-forge opt_einsum 3.3.0 pyhd8ed1ab_1 conda-forge packaging 20.9 pyh44b312d_0 conda-forge pandas 1.0.3 py38hcb8c335_1 conda-forge pandoc 2.12 h7f98852_0 conda-forge pandocfilters 1.4.2 py_1 conda-forge panel 0.9.5 py_0 pyviz param 1.10.1 py_0 pyviz parso 0.8.2 pyhd8ed1ab_0 conda-forge partd 1.2.0 pyhd8ed1ab_0 conda-forge pcre 8.44 he1b5a44_0 conda-forge pexpect 4.8.0 pyh9f0ad1d_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pillow 8.1.2 py38ha0e1e83_1 conda-forge pip 21.0.1 pyhd8ed1ab_0 conda-forge ply 3.11 pypi_0 pypi proj 7.2.0 h277dcde_2 conda-forge prometheus_client 0.10.1 pyhd8ed1ab_0 conda-forge prompt-toolkit 3.0.18 pyha770c72_0 conda-forge prompt_toolkit 3.0.18 hd8ed1ab_0 conda-forge protobuf 3.15.8 py38h709712a_0 conda-forge psutil 5.8.0 py38h497a2fe_1 conda-forge pthread-stubs 0.4 h36c2ea0_1001 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge py-xgboost 1.3.3 py38h578d9bd_2 conda-forge pyasn1 0.4.8 py_0 conda-forge pyasn1-modules 0.2.7 py_0 conda-forge pycparser 2.20 pyh9f0ad1d_2 conda-forge pyct 0.4.6 py_0 pyviz pyct-core 0.4.6 py_0 pyviz pygments 2.8.1 pyhd8ed1ab_0 conda-forge pyjwt 2.0.1 pyhd8ed1ab_1 conda-forge pyopenssl 20.0.1 pyhd8ed1ab_0 conda-forge pyparsing 2.4.7 pyh9f0ad1d_0 conda-forge pyphonetics 0.5.3 pypi_0 pypi pyqt 5.9.2 py38h05f1152_4 pyqt5-sip 4.19.18 py38h709712a_7 conda-forge pyrsistent 0.17.3 py38h497a2fe_2 conda-forge pyshp 2.1.3 pyh44b312d_0 conda-forge pysocks 1.7.1 py38h578d9bd_3 conda-forge python 3.8.8 hffdb5ce_0_cpython conda-forge python-dateutil 2.8.1 py_0 conda-forge python-flatbuffers 1.12 pyhd8ed1ab_1 conda-forge python-io-wrapper 0.2 pypi_0 pypi python-slugify 4.0.1 pypi_0 pypi python-snappy 0.6.0 py38h49bdff1_0 conda-forge python_abi 3.8 1_cp38 conda-forge pytz 2021.1 pyhd8ed1ab_0 conda-forge pyviz_comms 2.0.1 py_0 pyviz pyyaml 5.4.1 py38h497a2fe_0 conda-forge pyzmq 22.0.3 py38h2035c66_1 conda-forge qt 5.9.7 h5867ecd_1 qtconsole 5.0.3 pyhd8ed1ab_0 conda-forge qtpy 1.9.0 py_0 conda-forge quantulum3 0.7.6 pypi_0 pypi ratelimit 2.2.1 pypi_0 pypi re2 2021.04.01 h9c3ff4c_0 conda-forge readline 8.0 he28a2e2_2 conda-forge requests 2.25.1 pyhd3deb0d_0 conda-forge requests-cache 0.6.2 pypi_0 pypi requests-file 1.5.1 pypi_0 pypi requests-oauthlib 1.3.0 pyh9f0ad1d_0 conda-forge rise 5.7.1 py38h578d9bd_0 conda-forge rsa 4.7.2 pyh44b312d_0 conda-forge ruamel-yaml 0.17.4 pypi_0 pypi ruamel-yaml-clib 0.2.2 pypi_0 pypi s3transfer 0.3.7 pypi_0 pypi scikit-learn 0.24.1 py38h658cfdd_0 conda-forge scipy 1.6.2 py38h7b17777_0 conda-forge send2trash 1.5.0 py_0 conda-forge setuptools 49.6.0 py38h578d9bd_3 conda-forge shapely 1.7.1 py38h4fc1155_4 conda-forge sip 4.19.13 py38he6710b0_0 six 1.15.0 pyh9f0ad1d_0 conda-forge snappy 1.1.8 he1b5a44_3 conda-forge sortedcontainers 2.3.0 pyhd8ed1ab_0 conda-forge soupsieve 2.2.1 pypi_0 pypi sqlalchemy 1.4.8 pypi_0 pypi sqlite 3.35.4 h74cdb3f_0 conda-forge stopit 1.1.2 py_0 conda-forge tabulator 1.53.5 pypi_0 pypi tblib 1.7.0 pyhd8ed1ab_0 conda-forge tensorboard 2.4.1 pyhd8ed1ab_0 conda-forge tensorboard-plugin-wit 1.8.0 pyh44b312d_0 conda-forge tensorflow 2.3.0 eigen_py38h71ff20e_0 tensorflow-base 2.3.0 eigen_py38hb57a387_0 tensorflow-estimator 2.4.0 pyh9656e83_0 conda-forge termcolor 1.1.0 py_2 conda-forge terminado 0.9.4 py38h578d9bd_0 conda-forge testpath 0.4.4 py_0 conda-forge text-unidecode 1.3 pypi_0 pypi threadpoolctl 2.1.0 pyh5ca1d4c_0 conda-forge thrift 0.11.0 py38he1b5a44_1001 conda-forge tk 8.6.10 h21135ba_1 conda-forge toolz 0.11.1 py_0 conda-forge tornado 6.1 py38h497a2fe_1 conda-forge tpot 0.11.7 pyhd8ed1ab_1 conda-forge tqdm 4.60.0 pyhd8ed1ab_0 conda-forge traitlets 5.0.5 py_0 conda-forge typing-extensions 3.7.4.3 0 conda-forge typing_extensions 3.7.4.3 py_0 conda-forge unicodecsv 0.14.1 pypi_0 pypi unidecode 1.2.0 pypi_0 pypi update_checker 0.18.0 pyh9f0ad1d_0 conda-forge url-normalize 1.4.3 pypi_0 pypi urllib3 1.26.4 pyhd8ed1ab_0 conda-forge wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 py_1 conda-forge werkzeug 1.0.1 pyh9f0ad1d_0 conda-forge wheel 0.36.2 pyhd3deb0d_0 conda-forge widgetsnbextension 3.5.1 py38h578d9bd_4 conda-forge wrapt 1.12.1 py38h497a2fe_3 conda-forge xarray 0.15.1 py_0 conda-forge xgboost 1.3.3 py38h578d9bd_2 conda-forge xlrd 2.0.1 pypi_0 pypi xlrd3 1.0.0 pypi_0 pypi xorg-libxau 1.0.9 h7f98852_0 conda-forge xorg-libxdmcp 1.1.3 h7f98852_0 conda-forge xz 5.2.5 h516909a_1 conda-forge yaml 0.2.5 h516909a_0 conda-forge yarl 1.6.3 py38h497a2fe_1 conda-forge zeromq 4.3.4 h9c3ff4c_0 conda-forge zict 2.0.0 py_0 conda-forge zipp 3.4.1 pyhd8ed1ab_0 conda-forge zlib 1.2.11 h516909a_1010 conda-forge zstd 1.4.9 ha95c52a_0 conda-forge

Description of expected behavior and the observed behavior

I expect the geoviews module to be imported in Jupyter Notebook with: import geoviews as gv

Complete, minimal, self-contained example code that reproduces the issue

import geoviews as gv

Stack traceback and/or browser JavaScript console output


ModuleNotFoundError Traceback (most recent call last)

in 1 from PIL import Image ----> 2 import geoviews as gv 3 import geoviews.feature as gf 4 import xarray as xr 5 from cartopy import crs ModuleNotFoundError: No module named 'geoviews'
jbednar commented 3 years ago

This looks like an issue with how you are using conda, not with geoviews. In Jupyter, you're presumably not running the same python executable as you were in ipython, and each python executable has its own set of associated installed libraries. You may need to select a different kernel in jupyter, or to start jupyter a different way. You can check which executable you are using by looking at the value of sys.executable in ipython and in Jupyter; until those are the same the two environments won't act the same.

Ludo915 commented 3 years ago

Yes you are right. Thank you!