euporie icon indicating copy to clipboard operation
euporie copied to clipboard

Doesn't start

Open raffaem opened this issue 1 year ago • 6 comments

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.

raffaem avatar Dec 23 '23 09:12 raffaem

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.

joouha avatar Dec 23 '23 10:12 joouha

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)

raffaem avatar Dec 23 '23 12:12 raffaem

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 avatar Dec 27 '23 10:12 joouha

universal_pathlib does not support Python 3.12 yet:

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

joouha avatar Jan 02 '24 22:01 joouha

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

raffaem avatar Jan 03 '24 10:01 raffaem

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

joouha avatar Jan 04 '24 19:01 joouha

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/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/pathlib.py)

kimjisena avatar Feb 29 '24 05:02 kimjisena

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 avatar Feb 29 '24 15:02 joouha

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

joouha avatar Mar 01 '24 22:03 joouha