Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
danerlt opened this issue May 15, 2023 · 9 comments

Comments

@danerlt
Copy link

danerlt commented May 15, 2023

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
Copy link
Owner

This was fixed on #147

Should be available in the next release.

@cpnielsen
Copy link

@danielfrg Any idea when the next release will be?

@danielfrg
Copy link
Owner

danielfrg commented Jun 30, 2023

I think this should be released

@cpnielsen
Copy link

@danielfrg The latest release was v0.24.1 on the 22nd of March - this was merged in after: 0.24.1...main

@danielfrg
Copy link
Owner

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

@blaylockbk
Copy link

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
Copy link

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

@liquidcarbon
Copy link

Started getting those warnings when just running tests on a skeleton package.

Oddly, they appear/disappear in response to just this line:
from loguru import logger
Tried to disable jupyter_core or jupyter_client but no luck yet.

@DeaMariaLeon
Copy link

I have the same warning. @danielfrg would you have any advice on this?
BTW: Thank you for creating this project. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants