joouha / euporie

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

Doesn't start #97

Closed raffaem closed 4 months ago

raffaem commented 6 months ago

Installed the git version on Python 3.12

➜ euporie-notebook --autocomplete --autosuggest --autoinspect --log-file $HOME/Documents/euporie.log --log-level info --kernel-name=python tet.ipynb
Traceback (most recent call last):
  File "/home/raffaele/.pyenv/versions/3.12.0/bin/euporie-notebook", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/euporie/notebook/__main__.py", line 8, in main
    from euporie.core import __main__
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/euporie/core/__init__.py", line 14, in <module>
    from euporie.core import path  # noqa F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/euporie/core/path.py", line 14, in <module>
    import upath
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/upath/__init__.py", line 4, in <module>
    from upath.core import UPath
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/upath/core.py", line 7, in <module>
    from pathlib import _PosixFlavour  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name '_PosixFlavour' from 'pathlib' (/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/pathlib.py)

This upath library seems to be unmaintained since 4 years.

joouha commented 6 months ago

Hi,

The upath here is actaully universal_pathlib, which is very much actively maintained.

However, there were some fairly major changes in universal_pathlib in v0.0.24, which require some reworking in euporie to things working again (I'm planning to look at this soon).

For this reason euporie has the dependency universal-pathlib<0.0.24.

You will find that if you pip install universal_pathlib==0.0.23 euporie should work again.

raffaem commented 6 months ago

it doesn't, same error

❯ pip install universal_pathlib==0.0.23
Collecting universal_pathlib==0.0.23
  Using cached universal_pathlib-0.0.23-py3-none-any.whl (28 kB)
Requirement already satisfied: fsspec in /home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages (from universal_pathlib==0.0.23) (2023.10.0)
Installing collected packages: universal_pathlib
Successfully installed universal_pathlib-0.0.23

[notice] A new release of pip is available: 23.3.1 -> 23.3.2
[notice] To update, run: pip install --upgrade pip

~/Documents took 5s 
➜ enp test.ipynb
Traceback (most recent call last):
  File "/home/raffaele/.pyenv/versions/3.12.0/bin/euporie-notebook", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/euporie/notebook/__main__.py", line 8, in main
    from euporie.core import __main__
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/euporie/core/__init__.py", line 14, in <module>
    from euporie.core import path  # noqa F401
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/euporie/core/path.py", line 14, in <module>
    import upath
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/upath/__init__.py", line 4, in <module>
    from upath.core import UPath
  File "/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/site-packages/upath/core.py", line 7, in <module>
    from pathlib import _PosixFlavour  # type: ignore
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: cannot import name '_PosixFlavour' from 'pathlib' (/home/raffaele/.pyenv/versions/3.12.0/lib/python3.12/pathlib.py)
joouha commented 6 months ago

Ah I see, this appears to be due to the changes made to pathlib in Python 3.12

I'll start work on a fix

joouha commented 6 months ago

universal_pathlib does not support Python 3.12 yet:

https://github.com/fsspec/universal_pathlib/pull/152

raffaem commented 6 months ago

We need to install euporie in a virtual environment different than the one in which the software is running

joouha commented 6 months ago

Yes, this is the recommended approach. I use pipx to do this easily.

kimjisena commented 4 months ago

Any updates on this issue?

The current version of universal_pathlib at the time of writing (0.2.1) supports python 3.12 but euporie throws this error.

Traceback (most recent call last):
  File "/Users/0xrafikii/.local/bin/euporie", line 7, in <module>
    from euporie.core.__main__ import main
  File "/Users/0xrafikii/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/0xrafikii/Library/Application Support/pipx/venvs/euporie/lib/python3.12/site-packages/euporie/core/path.py", line 11, in <module>
    import upath
  File "/Users/0xrafikii/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/0xrafikii/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.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/pathlib.py)
joouha commented 4 months ago

Hi - the dev branch should work with Python 3.12 (a few changes were required to work with the new universal_pathlib release).

I need to make a new release.

joouha commented 4 months ago

I've just released v2.8.0, which should work with Python 3.12