Skip to content

Instantly share code, notes, and snippets.

@donmccurdy
Last active April 12, 2024 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donmccurdy/4cb069e73cbb82b6e5f75a0b3a6bb74f to your computer and use it in GitHub Desktop.
Save donmccurdy/4cb069e73cbb82b6e5f75a0b3a6bb74f to your computer and use it in GitHub Desktop.
Pydeck Troubleshooting

Pydeck Troubleshooting

πŸš€ Quickstart

yarn bootstrap

# create virtualenv
cd bindings/pydeck
make setup-env
. env/bin/activate

# build pydeck locally
make init
make prepare-jupyter

# start notebook with pydeck linked locally
env/bin/jupyter notebook

# build pydeck_carto locally
# ⁉️




βœ… ModuleNotFoundError: No module named 'setuptools'

Start the virtualenv as described in the contributing guide and this goes away.




βœ… nbextensions not found

Cannot be installed manually, we need to stick with jupyterlab 3.x or lower.

Pin this in requirements-dev.txt β€”

jupyterlab<4.0.0

For that matter, we should probably pin everything in requirements-dev.txt.




⚠️ Installing extensions with the jupyter labextension install command is now deprecated...

(Deprecated) Installing extensions with the jupyter labextension install command is now deprecated and will be removed in a future major version of JupyterLab.

Users should manage prebuilt extensions with package managers like pip and conda, and extension authors are encouraged to distribute their extensions as prebuilt packages (Deprecated) Installing extensions with the jupyter labextension install command is now deprecated and will be removed in a future major version of JupyterLab.

Users should manage prebuilt extensions with package managers like pip and conda, and extension authors are encouraged to distribute their extensions as prebuilt packages

The widget bindings need a substantial overhaul to support Jupyter Notebook v7 and JupyterLab v4. End of maintenance for lower versions may begin in May, 2024. Large design decisions remain about how to proceed after that. Consider anywidget to ease the process, as lonboard and ipydeck have done. Also see the migration plan.




βœ… To initialize this nbextension in the browser every time...

To initialize this nbextension in the browser every time the notebook (or other app) loads:
	  jupyter nbextension enable pydeck --py --sys-prefix

This should automatically be handled by make prepare-notebook. If not, perhaps your enviromnent resolves the wrong version of jupyter. Consider forcing it to use the binary from the virtual env with:

env/bin/jupyter nbextension enable pydeck --py --sys-prefix




βœ… You must use Jupyter Server v1 to load JupyterLab as notebook extension. You have v2.5.0 installed.

[!WARNING] WARNING Loading JupyterLab as a classic notebook (v6) extension. You must use Jupyter Server v1 to load JupyterLab as notebook extension. You have v2.5.0 installed. You can fix this by executing:

pip install -U "jupyter-server<2.0.0"

Resolved with pip install -U "jupyter-server<2.0.0", or add this to a requirements.txt.




βœ… Widgets are not available. Please install widgetsnbextension or ipywidgets 4.0

[!WARNING] WARNING main.js:240 Widgets are not available. Please install widgetsnbextension or ipywidgets 4.0

Start the notebook with env/bin/jupyter notebook instead of jupyter notebook.




βœ… ModuleNotFoundError: No module named 'pydeck'

[!WARNING] Warning jupyter nbextension enable pydeck --py --sys-prefix Traceback (most recent call last): File "/Users/donmccurdy/.pyenv/versions/3.10.13/bin/jupyter-nbextension", line 8, in module ModuleNotFoundError: No module named 'pydeck'

Start the notebook with env/bin/jupyter notebook instead of jupyter notebook.




❌ py_carto not found

Unsolved.




❌ Object prototype may only be an Object or null: undefined

Unsolved. Work around this by using to_html instead of show.




❌ Mismatched anonymous define() module

See above.




❌ Could not create a view for model id

See above.




❌ other errors

Sometimes the virtualenv gets into a broken state, but better that than your dev environment. Delete the virtual env with...

rm -rf env *.egg-info

... then restart the quickstart steps above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment