joouha / euporie

Jupyter notebooks in the terminal
https://euporie.readthedocs.io
MIT License
1.54k stars 36 forks source link

ImportError: cannot import name '_PosixFlavour' from 'pathlib' #100

Closed tomsturges closed 3 months ago

tomsturges commented 4 months ago

I'm getting the following error and I'm not really sure how to start fixing this problem.

$ euporie-notebook optimization_twodevices_FAU_angular_Jan2024.ipynb
Traceback (most recent call last):
  File "/Users/tomsturges/.local/bin/euporie-notebook", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/tomsturges/Library/Application Support/pipx/venvs/euporie/lib/python3.12/site-packages/euporie/notebook/__main__.py", line 8, in main
    from euporie.core import __main__
  File "/Users/tomsturges/Library/Application Support/pipx/venvs/euporie/lib/python3.12/site-packages/euporie/core/__init__.py", line 14, in <module>
    from euporie.core import path  # noqa F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/tomsturges/Library/Application Support/pipx/venvs/euporie/lib/python3.12/site-packages/euporie/core/path.py", line 11, in <module>
    import upath
  File "/Users/tomsturges/Library/Application Support/pipx/venvs/euporie/lib/python3.12/site-packages/upath/__init__.py", line 2, in <module>
    from upath.core import UPath
  File "/Users/tomsturges/Library/Application Support/pipx/venvs/euporie/lib/python3.12/site-packages/upath/core.py", line 8, in <module>
    from pathlib import _PosixFlavour  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name '_PosixFlavour' from 'pathlib' (/opt/homebrew/Cellar/python@3.12/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/pathlib.py)
joouha commented 4 months ago

Technically euporie does not support Python 3.12 ... yet.

I'm still waiting on a new release of universal_pathlib compatible with 3.12 (see here). This should happen any day now.

There have been some fairly major changes to the pathlib standard library in 3.12, which has made things a bit more complicated for universal_pathlib than usual.

As soon as it's out, I'll make a new release of euporie ⚡

joouha commented 3 months ago

This should be fixed in the latest release, v2.8.1