danielfrg / mkdocs-jupyter

Use Jupyter Notebook in mkdocs
https://mkdocs-jupyter.danielfrg.com
Apache License 2.0
367 stars 45 forks source link

DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs #148

Closed danerlt closed 1 year ago

danerlt commented 1 year ago

I received a DeprecationWarning when using mkdocs-jupyter.

version info:

mkdocs==1.4.2
mkdocs-material==9.1.6
mknotebooks==0.7.1
mkdocs-jupyter==0.24.1

The DeprecationWarning as follows:

INFO     -  DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
given by the platformdirs library.  To remove this warning and
see the appropriate new directories, set the environment variable
`JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
The use of platformdirs will be the default in `jupyter_core` v6
  File "D:\ProgramData\Anaconda3\envs\docs\Lib\site-packages\jupyter_core\utils\__init__.py", line 89, in deprecation
    warnings.warn(message, DeprecationWarning, stacklevel=stacklevel + 1)
  File "D:\ProgramData\Anaconda3\envs\docs\Lib\site-packages\jupyter_client\connect.py", line 20, in 
    from jupyter_core.paths import jupyter_data_dir, jupyter_runtime_dir, secure_write
INFO     -  DeprecationWarning: defusedxml.cElementTree is deprecated, import from defusedxml.ElementTree instead.
  File "D:\ProgramData\Anaconda3\envs\docs\Lib\site-packages\mkdocs_jupyter\convert.py", line 16, in add_anchor_lower_id
    from defusedxml import cElementTree as ElementTree
  File "D:\ProgramData\Anaconda3\envs\docs\Lib\site-packages\defusedxml\cElementTree.py", line 38, in <module>
    warnings.warn(
danielfrg commented 1 year ago

This was fixed on https://github.com/danielfrg/mkdocs-jupyter/pull/147

Should be available in the next release.

cpnielsen commented 1 year ago

@danielfrg Any idea when the next release will be?

danielfrg commented 1 year ago

I think this should be released

cpnielsen commented 1 year ago

@danielfrg The latest release was v0.24.1 on the 22nd of March - this was merged in after: https://github.com/danielfrg/mkdocs-jupyter/compare/0.24.1...main

danielfrg commented 1 year ago

I just made a new release that should include this fix.

blaylockbk commented 3 months ago

Hi! I'm still seeing this warning...

INFO    -  DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs
           given by the platformdirs library.  To remove this warning and
           see the appropriate new directories, set the environment variable
           `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
           The use of platformdirs will be the default in `jupyter_core` v6
             File "/users/blaylock/miniconda3/envs/mkdocs/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 90, in
           deprecation
               warnings.warn(message, DeprecationWarning, stacklevel=stacklevel + 1)
             File "/users/blaylock/miniconda3/envs/mkdocs/lib/python3.11/site-packages/jupyter_client/connect.py", line 22, in
               from jupyter_core.paths import jupyter_data_dir, jupyter_runtime_dir, secure_write

My versions

mkdocs-jupyter            0.24.6
mkdocs-material           9.4.6

Am I missing something?

simonwei97 commented 1 month ago

I have same problem.

mkdocs-jupyter             0.24.7      Use Jupyter in mkdocs websites
mkdocs-material            9.5.26      Documentation that simply works

That logs mean jupyter_core v6 will set platformdirs as default, while in this repo dependencies, jupyter-core version is 5.7.2. This version is latest one. jupyter_core Releases

Would we ignore this log info? Then following the log tips, set the environment variable JUPYTER_PLATFORM_DIRS=1 and then run jupyter --paths.


Refer