ProjectPythia/pythia-foundations

Issue on page /core/pandas/pandas.html

Closed this issue · 13 comments

When trying to run the line "from pythia_datasets import datasets" receiving error:

ModuleNotFoundError Traceback (most recent call last)
Input In [3], in <cell line: 2>()
1 import pandas as pd
----> 2 from pythia_datasets import datasets

ModuleNotFoundError: No module named 'pythia_datasets'

Try to re-install it or check your tool settings about modules or write DATASETS like this

Hi @williamnicewonger, thanks for this report.

How / where are you running this notebook? Did you set up the necessary conda environment as described here: https://foundations.projectpythia.org/preamble/how-to-use.html#interacting-with-jupyter-books-locally?

Hi William,

Great! Please take a look through the earlier sections of Pythia Foundations for lots more guidance on how to get started.

Ok, we'll need a little more information.

Trying doing this from the same terminal you used to launch Jupyter notebook

conda list

and copy/paste the output here. This will show what's in your currently activated conda environment.

anaconda3/envs/pythia-book-dev:

Name Version Build Channel

alabaster 0.7.12 py_0 conda-forge
anyio 3.6.1 py310h2ec42d9_0 conda-forge
aom 3.3.0 h96cf925_1 conda-forge
appdirs 1.4.4 pyh9f0ad1d_0 conda-forge
appnope 0.1.3 pyhd8ed1ab_0 conda-forge
argon2-cffi 21.3.0 pyhd8ed1ab_0 conda-forge
argon2-cffi-bindings 21.2.0 py310h1961e1f_2 conda-forge
asttokens 2.0.5 pyhd8ed1ab_0 conda-forge
attrs 21.4.0 pyhd8ed1ab_0 conda-forge
babel 2.10.1 pyhd8ed1ab_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
beautifulsoup4 4.11.1 pyha770c72_0 conda-forge
bleach 5.0.0 pyhd8ed1ab_0 conda-forge
brotli 1.0.9 h5eb16cf_7 conda-forge
brotli-bin 1.0.9 h5eb16cf_7 conda-forge
brotlipy 0.7.0 py310h1961e1f_1004 conda-forge
bzip2 1.0.8 h0d85af4_4 conda-forge
c-ares 1.18.1 h0d85af4_0 conda-forge
ca-certificates 2022.5.18.1 h033912b_0 conda-forge
cartopy 0.20.2 py310he18ef84_4 conda-forge
certifi 2022.5.18.1 py310h2ec42d9_0 conda-forge
cffi 1.15.0 py310hcc37b68_0 conda-forge
cfgv 3.3.1 pyhd8ed1ab_0 conda-forge
cftime 1.6.0 py310h7f5fb2b_1 conda-forge
charset-normalizer 2.0.12 pyhd8ed1ab_0 conda-forge
click 8.1.3 py310h2ec42d9_0 conda-forge
click-completion 0.5.2 py310h2ec42d9_3 conda-forge
click-log 0.3.2 pyh9f0ad1d_0 conda-forge
colorama 0.4.4 pyh9f0ad1d_0 conda-forge
cryptography 37.0.2 py310h52c3658_0 conda-forge
curl 7.83.1 h372c54d_0 conda-forge
cycler 0.11.0 pyhd8ed1ab_0 conda-forge
dataclasses 0.8 pyhc8e2a94_3 conda-forge
debugpy 1.6.0 py310h9d931ec_0 conda-forge
decorator 5.1.1 pyhd8ed1ab_0 conda-forge
defusedxml 0.7.1 pyhd8ed1ab_0 conda-forge
distlib 0.3.4 pyhd8ed1ab_0 conda-forge
docutils 0.15.2 py310h2ec42d9_3 conda-forge
entrypoints 0.4 pyhd8ed1ab_0 conda-forge
executing 0.8.3 pyhd8ed1ab_0 conda-forge
ffmpeg 5.0.1 hf5e6f72_2 conda-forge
filelock 3.7.0 pyhd8ed1ab_0 conda-forge
flit-core 3.7.1 pyhd8ed1ab_0 conda-forge
fonttools 4.33.3 py310h6c45266_0 conda-forge
freetype 2.10.4 h4cff582_1 conda-forge
geos 3.10.2 he49afe7_0 conda-forge
gettext 0.19.8.1 hd1a6beb_1008 conda-forge
giflib 5.2.1 hbcb3906_2 conda-forge
gitdb 4.0.9 pyhd8ed1ab_0 conda-forge
gitpython 3.1.27 pyhd8ed1ab_0 conda-forge
gmp 6.2.1 h2e338ed_0 conda-forge
gnutls 3.6.13 h756fd2b_1 conda-forge
hdf4 4.2.15 hefd3b78_3 conda-forge
hdf5 1.12.1 nompi_ha60fbc9_104 conda-forge
icu 70.1 h96cf925_0 conda-forge
identify 2.5.1 pyhd8ed1ab_0 conda-forge
idna 3.3 pyhd8ed1ab_0 conda-forge
imagesize 1.3.0 pyhd8ed1ab_0 conda-forge
importlib-metadata 4.11.4 py310h2ec42d9_0 conda-forge
importlib_metadata 4.11.4 hd8ed1ab_0 conda-forge
importlib_resources 5.7.1 pyhd8ed1ab_1 conda-forge
ipykernel 6.13.0 py310ha188af9_0 conda-forge
ipython 8.3.0 py310h2ec42d9_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
ipywidgets 7.7.0 pyhd8ed1ab_0 conda-forge
jedi 0.18.1 py310h2ec42d9_1 conda-forge
jinja2 3.0.3 pyhd8ed1ab_0 conda-forge
jpeg 9e h5eb16cf_1 conda-forge
json5 0.9.5 pyh9f0ad1d_0 conda-forge
jsonschema 3.2.0 pyhd8ed1ab_3 conda-forge
jupyter-book 0.12.3 pyhd8ed1ab_0 conda-forge
jupyter-cache 0.4.3 pyhd8ed1ab_0 conda-forge
jupyter-server-mathjax 0.2.5 pyhc268e32_0 conda-forge
jupyter-sphinx 0.3.2 pyhd8ed1ab_1 conda-forge
jupyter_client 7.3.1 pyhd8ed1ab_0 conda-forge
jupyter_core 4.10.0 py310h2ec42d9_0 conda-forge
jupyter_server 1.17.0 pyhd8ed1ab_0 conda-forge
jupyterlab 3.4.2 pyhd8ed1ab_0 conda-forge
jupyterlab_pygments 0.2.2 pyhd8ed1ab_0 conda-forge
jupyterlab_server 2.14.0 pyhd8ed1ab_0 conda-forge
jupyterlab_widgets 1.1.0 pyhd8ed1ab_0 conda-forge
kiwisolver 1.4.2 py310h6be76da_1 conda-forge
krb5 1.19.3 hb49756b_0 conda-forge
lame 3.100 h35c211d_1001 conda-forge
latexcodec 2.0.1 pyh9f0ad1d_0 conda-forge
lcms2 2.12 h577c468_0 conda-forge
lerc 3.0 he49afe7_0 conda-forge
libblas 3.9.0 14_osx64_openblas conda-forge
libbrotlicommon 1.0.9 h5eb16cf_7 conda-forge
libbrotlidec 1.0.9 h5eb16cf_7 conda-forge
libbrotlienc 1.0.9 h5eb16cf_7 conda-forge
libcblas 3.9.0 14_osx64_openblas conda-forge
libcurl 7.83.1 h372c54d_0 conda-forge
libcxx 14.0.4 hc203e6f_0 conda-forge
libdeflate 1.10 h0d85af4_0 conda-forge
libedit 3.1.20191231 h0678c8f_2 conda-forge
libev 4.33 haf1e3a3_1 conda-forge
libffi 3.4.2 h0d85af4_5 conda-forge
libgfortran 5.0.0 9_3_0_h6c81a4c_23 conda-forge
libgfortran5 9.3.0 h6c81a4c_23 conda-forge
libiconv 1.16 haf1e3a3_0 conda-forge
liblapack 3.9.0 14_osx64_openblas conda-forge
libnetcdf 4.8.1 nompi_h6609ca0_102 conda-forge
libnghttp2 1.47.0 h942079c_0 conda-forge
libopenblas 0.3.20 openmp_hb3cd9ec_0 conda-forge
libpng 1.6.37 h7cec526_2 conda-forge
libsodium 1.0.18 hbcb3906_1 conda-forge
libssh2 1.10.0 h52ee1ee_2 conda-forge
libtiff 4.3.0 hfca7e8f_4 conda-forge
libvpx 1.11.0 he49afe7_3 conda-forge
libwebp 1.2.2 h28dabe5_0 conda-forge
libwebp-base 1.2.2 h0d85af4_1 conda-forge
libxcb 1.13 h0d85af4_1004 conda-forge
libxml2 2.9.14 h08a9926_0 conda-forge
libzip 1.8.0 h8b0c345_1 conda-forge
libzlib 1.2.11 h6c3fc93_1014 conda-forge
linkify-it-py 1.0.3 pyhd8ed1ab_0 conda-forge
llvm-openmp 14.0.4 ha654fa7_0 conda-forge
lz4-c 1.9.3 he49afe7_1 conda-forge
markdown-it-py 1.1.0 pyhd8ed1ab_0 conda-forge
markupsafe 2.1.1 py310h1961e1f_1 conda-forge
matplotlib 3.5.2 py310h2ec42d9_0 conda-forge
matplotlib-base 3.5.2 py310h4510841_0 conda-forge
matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge
mdit-py-plugins 0.2.8 pyhd8ed1ab_0 conda-forge
mistune 0.8.4 py310he24745e_1005 conda-forge
munkres 1.1.4 pyh9f0ad1d_0 conda-forge
myst-nb 0.13.2 pyhd8ed1ab_0 conda-forge
myst-parser 0.15.2 pyhd8ed1ab_0 conda-forge
nbclassic 0.3.7 pyhd8ed1ab_0 conda-forge
nbclient 0.5.13 pyhd8ed1ab_0 conda-forge
nbconvert 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-core 6.5.0 pyhd8ed1ab_0 conda-forge
nbconvert-pandoc 6.5.0 pyhd8ed1ab_0 conda-forge
nbdime 3.1.1 pyhd8ed1ab_0 conda-forge
nbformat 5.4.0 pyhd8ed1ab_0 conda-forge
nc-time-axis 1.4.1 pyhd8ed1ab_0 conda-forge
ncurses 6.3 h96cf925_1 conda-forge
nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge
netcdf4 1.5.8 nompi_py310h1579a17_101 conda-forge
nettle 3.6 hedd7734_0 conda-forge
nodeenv 1.6.0 pyhd8ed1ab_0 conda-forge
notebook 6.4.11 pyha770c72_0 conda-forge
notebook-shim 0.1.0 pyhd8ed1ab_0 conda-forge
numpy 1.22.4 py310hed37afb_0 conda-forge
openh264 2.1.1 hfd3ada9_0 conda-forge
openjpeg 2.4.0 h6e7aa92_1 conda-forge
openssl 1.1.1o hfe4f2af_0 conda-forge
packaging 21.3 pyhd8ed1ab_0 conda-forge
pandas 1.4.2 py310h3099161_2 conda-forge
pandoc 2.18 h694c41f_0 conda-forge
pandocfilters 1.5.0 pyhd8ed1ab_0 conda-forge
parso 0.8.3 pyhd8ed1ab_0 conda-forge
pexpect 4.8.0 pyh9f0ad1d_2 conda-forge
pickleshare 0.7.5 py_1003 conda-forge
pillow 9.1.1 py310hb3240ae_0 conda-forge
pip 22.1.1 pyhd8ed1ab_0 conda-forge
platformdirs 2.5.1 pyhd8ed1ab_0 conda-forge
pooch 1.6.0 pyhd8ed1ab_0 conda-forge
pre-commit 2.19.0 py310h2ec42d9_0 conda-forge
proj 9.0.0 h2364a93_1 conda-forge
prometheus_client 0.14.1 pyhd8ed1ab_0 conda-forge
prompt-toolkit 3.0.29 pyha770c72_0 conda-forge
psutil 5.9.1 py310h6c45266_0 conda-forge
pthread-stubs 0.4 hc929b4f_1001 conda-forge
ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge
pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge
pybtex 0.24.0 pyhd8ed1ab_2 conda-forge
pybtex-docutils 1.0.1 py310h2ec42d9_1 conda-forge
pycparser 2.21 pyhd8ed1ab_0 conda-forge
pydata-sphinx-theme 0.7.2 pyhd8ed1ab_0 conda-forge
pygments 2.12.0 pyhd8ed1ab_0 conda-forge
pyopenssl 22.0.0 pyhd8ed1ab_0 conda-forge
pyparsing 3.0.9 pyhd8ed1ab_0 conda-forge
pyproj 3.3.1 py310h6c09501_0 conda-forge
pyrsistent 0.18.1 py310h1961e1f_1 conda-forge
pyshp 2.3.0 pyhd8ed1ab_0 conda-forge
pysocks 1.7.1 py310h2ec42d9_5 conda-forge
pythia-datasets 2021.9.21 pyhd8ed1ab_0 conda-forge
python 3.10.4 h8b4d769_0_cpython conda-forge
python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge
python-fastjsonschema 2.15.3 pyhd8ed1ab_0 conda-forge
python_abi 3.10 2_cp310 conda-forge
pytz 2022.1 pyhd8ed1ab_0 conda-forge
pyyaml 6.0 py310h1961e1f_4 conda-forge
pyzmq 23.0.0 py310h85fb675_0 conda-forge
readline 8.1 h05e3726_0 conda-forge
requests 2.27.1 pyhd8ed1ab_0 conda-forge
scipy 1.8.1 py310h1f9c157_0 conda-forge
send2trash 1.8.0 pyhd8ed1ab_0 conda-forge
setuptools 62.3.2 py310h2ec42d9_0 conda-forge
shapely 1.8.2 py310h6d09efd_1 conda-forge
shellingham 1.4.0 pyh44b312d_0 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
smmap 3.0.5 pyh44b312d_0 conda-forge
sniffio 1.2.0 py310h2ec42d9_3 conda-forge
snowballstemmer 2.2.0 pyhd8ed1ab_0 conda-forge
soupsieve 2.3.1 pyhd8ed1ab_0 conda-forge
sphinx 4.5.0 pyh6c4a22f_0 conda-forge
sphinx-book-theme 0.1.10 pyhd8ed1ab_1 conda-forge
sphinx-comments 0.0.3 pyh9f0ad1d_0 conda-forge
sphinx-copybutton 0.5.0 pyhd8ed1ab_0 conda-forge
sphinx-external-toc 0.2.4 pyhd8ed1ab_0 conda-forge
sphinx-jupyterbook-latex 0.4.6 pyhd8ed1ab_0 conda-forge
sphinx-multitoc-numbering 0.1.3 pyhd8ed1ab_0 conda-forge
sphinx-panels 0.6.0 pyhd8ed1ab_0 conda-forge
sphinx-pythia-theme 2022.3.29 pypi_0 pypi
sphinx-thebe 0.1.2 pyhd8ed1ab_0 conda-forge
sphinx-togglebutton 0.3.1 pyhd8ed1ab_0 conda-forge
sphinxcontrib-applehelp 1.0.2 py_0 conda-forge
sphinxcontrib-bibtex 2.4.2 pyhd8ed1ab_0 conda-forge
sphinxcontrib-devhelp 1.0.2 py_0 conda-forge
sphinxcontrib-htmlhelp 2.0.0 pyhd8ed1ab_0 conda-forge
sphinxcontrib-jsmath 1.0.1 py_0 conda-forge
sphinxcontrib-qthelp 1.0.3 py_0 conda-forge
sphinxcontrib-serializinghtml 1.1.5 pyhd8ed1ab_2 conda-forge
sqlalchemy 1.3.24 py310h1961e1f_1 conda-forge
sqlite 3.38.5 hd9f0692_0 conda-forge
stack_data 0.2.0 pyhd8ed1ab_0 conda-forge
svt-av1 1.1.0 hb486fe8_1 conda-forge
terminado 0.15.0 py310h2ec42d9_0 conda-forge
tinycss2 1.1.1 pyhd8ed1ab_0 conda-forge
tk 8.6.12 h5dbffcc_0 conda-forge
toml 0.10.2 pyhd8ed1ab_0 conda-forge
tornado 6.1 py310h1961e1f_3 conda-forge
traitlets 5.2.1.post0 pyhd8ed1ab_0 conda-forge
typing_extensions 4.2.0 pyha770c72_1 conda-forge
tzdata 2022a h191b570_0 conda-forge
uc-micro-py 1.0.1 pyhd8ed1ab_0 conda-forge
ukkonen 1.0.1 py310h6be76da_2 conda-forge
unicodedata2 14.0.0 py310h1961e1f_1 conda-forge
urllib3 1.26.9 pyhd8ed1ab_0 conda-forge
virtualenv 20.14.1 py310h2ec42d9_0 conda-forge
wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge
webencodings 0.5.1 py_1 conda-forge
websocket-client 1.3.2 pyhd8ed1ab_0 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
widgetsnbextension 3.6.0 py310h2ec42d9_0 conda-forge
x264 1!161.3030 h0d85af4_1 conda-forge
x265 3.5 hbb4e6a2_3 conda-forge
xarray 2022.3.0 pyhd8ed1ab_0 conda-forge
xorg-libxau 1.0.9 h35c211d_0 conda-forge
xorg-libxdmcp 1.1.3 h35c211d_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
yaml 0.2.5 h0d85af4_2 conda-forge
zeromq 4.3.4 he49afe7_1 conda-forge
zipp 3.8.0 pyhd8ed1ab_0 conda-forge
zlib 1.2.11 h6c3fc93_1014 conda-forge
zstd 1.5.2 ha9df2e0_1 conda-forge

@ProjectPythia/infrastructure anyone have an idea what's going on here? pythia-datasets is in the conda environment, but from pythia_datasets import DATASETS raising a ModuleNotFoundError

ktyle commented

@williamnicewonger what OS are you running?

@brian-rose , while I was able to build the environment which installed python 3.10.4 (Linux amd64) and after activating, could run the import without error, I noticed a couple curiosities:

  1. The conda solve took significantly longer than it has in the past
  2. Likely related to (1), several packages in the environment (e.g., cartopy, matplotlib) were pulled from Pypi instead of conda-forge

I then built an environment with python<3.10 (3.9.13 in this case). The pythia-datasets import worked as well, and the two issues noted above with 3.10.4 did not occur.

@ktyle I am running macOS Monterey version 12.4

ktyle commented

Hmmm on my M1 Mac (also 12.4), the environment built properly and I was able to import pythia_datasets without error.

@williamnicewonger Looks like you're using Anaconda Navigator to launch Jupyter? If so, make sure you're running Jupyter from within the activated environment you listed above, and not from the base environment in the Navigator. From the terminal:

conda activate pythia-book-dev
conda info
jupyter lab

then try from pythia_datasets import DATASETS from within that Jupyter Lab instance. If that still doesn't work, please provide us with the output of conda info above (feel free to modify directory names, etc. if preferred.)

You can also switch environments from within the Navigator if needed, though I'd need to brush up on where exactly that's done.

Unrelated, @ktyle I did not run into the same environment resolution issues you described with conda or mamba on osx-arm64. I haven't tried on rosetta osx-64 yet.

Wow.. I feel silly now. Thank you so much @dcamron! That was the issue. Thank you @ktyle @brian-rose and @Cescoooo as well for the support. I'll continue on with my foundations courses. Thanks project pythia for offering these!