GiorgosXou / TUIFIManager

A cross-platform terminal-based termux-oriented file manager (and component), meant to be used with a Uni-Curses project or as is.
GNU General Public License v3.0
688 stars 13 forks source link

ncurses not found but existing on macOS #28

Closed ghoffart closed 1 year ago

ghoffart commented 1 year ago

Installed via: % pip3 install TUIFIManager --upgrade

Run as: % tuifi

Got:

goetz@host ~ % tuifi
Traceback (most recent call last):
  File "/opt/homebrew/bin/tuifi", line 5, in <module>
    from TUIFIManager.__main__ import main
  File "/opt/homebrew/lib/python3.10/site-packages/TUIFIManager/__init__.py", line 9, in <module>
    from       .TUIMenu import    *
  File "/opt/homebrew/lib/python3.10/site-packages/TUIFIManager/TUIMenu.py", line 2, in <module>
    import unicurses
  File "/opt/homebrew/lib/python3.10/site-packages/unicurses/__init__.py", line 119, in <module>
    ncurses,panel = get_libncursesw_paths()
  File "/opt/homebrew/lib/python3.10/site-packages/unicurses/__init__.py", line 79, in get_libncursesw_paths
    raise Exception('NCursesNotFound: ' + msg)
Exception: NCursesNotFound: No version of shared-libraries of ncurses found on this system, please try `brew install ncurses` if this won't work please create an issue

goetz@host ~ % brew install ncurses
==> Auto-updated Homebrew!
[…]
Running `brew update --auto-update`...
[…]

Warning: ncurses 6.3 is already installed and up-to-date.
To reinstall 6.3, run:
  brew reinstall ncurses

goetz@host ~ % sw_vers
ProductName:        macOS
ProductVersion:     13.1
BuildVersion:       22C65

… on ARM64.

GiorgosXou commented 1 year ago

Good News

Good news is that I've had a similar issue in TERMUX with the in-built from ctypes.util import find_library function and there is already a plan B in the todo list which i think it used to work with macOS too.

Bad News

Is that I don't have or use macOS, and I might need some help if the plan B won't work

Permanent Solution

As of now, until I push the new release you could try the steps below for a permanent solution:

GiorgosXou commented 1 year ago

could you run this command on your terminal and tell me what it prints:

python -c "from ctypes.util import find_library;lib_paths=[find_library('ncursesw'),find_library('panelw')];print(lib_paths)"
sainishwanth commented 1 year ago

Found the Issue.

In the unicurses library under init.py a call is being made to get_libncursesw_paths() which in turn calls find_library from ctypes.util

lib_paths = [find_library('ncursesw'),find_library('panelw')]

The packages are named ncurses and panel in MacOSX, not ncursesw and panelw

I have a made a pull request to fix this on ur unicurses library if you'd like to check it.