joouha / ranger_tmux

Tmux integration for ranger
MIT License
37 stars 5 forks source link

Installation error #2

Closed omhland closed 2 years ago

omhland commented 2 years ago

Hi, the installation does not work for me. python -m ranger_tmux install yields

Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/ole/.local/lib/python3.8/site-packages/ranger_tmux/__main__.py", line 193, in <module>
    main()
  File "/home/ole/.local/lib/python3.8/site-packages/ranger_tmux/__main__.py", line 172, in main
    default=importlib_resources.files("ranger_tmux").joinpath("plugin.py"),
AttributeError: module 'importlib.resources' has no attribute 'files'

I've tried downloading both ranger-tmux and ranger_tmux. Is this a bug? Or is there any unlisted installation requirements?

Note that this is the first ranger plugin that I am installing.

joouha commented 2 years ago

Hi, yes this is a bug.

The reason is that I'm using importlib.resources.files, which was not added until Python 3.9. I'm therefore using the backported package importlib_resources for older versions of Python, but my implementation of the import fallback was a bit off.

I've made a fix (ce39d71636b054bb827b6779d19671d27d1a4cd8) and pushed a new release to PyPI - let me know if it works.

omhland commented 2 years ago

Hi, it didn't work any better but tried installing with 3.9 and that worked like a charm. I can give you more environment info if you need it, but I will call it a day.

BTW, can you use this to open files in an existing vim session (by default)?

joouha commented 2 years ago

It looks like it should be possible to do that using neovim-remote. You'd have to configure your rifle to open files using nvr.