hykilpikonna / hyfetch

🏳️‍🌈 🏳️‍⚧️ Neofetch with LGBTQ+ pride flags!
MIT License
1.27k stars 96 forks source link

Unable to run Hyfetch on Windows 10 #16

Closed comradef191 closed 1 year ago

comradef191 commented 2 years ago

Description

Hyfetch is unable to run on Windows 10 Currently installed version of Python is 3.10.4

Release 1.4.0

Installed using pip Powershell & Command Prompt: Setup functions as expected, until you select a brightness, upon which you will be met with the following error:

Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\f191\AppData\Roaming\Python\Python310\Scripts\hyfetch.exe\__main__.py", line 7, in <module>
  File "C:\Users\f191\AppData\Roaming\Python\Python310\site-packages\hyfetch\main.py", line 299, in run
    config = check_config()
  File "C:\Users\f191\AppData\Roaming\Python\Python310\site-packages\hyfetch\main.py", line 33, in check_config
    return create_config()
  File "C:\Users\f191\AppData\Roaming\Python\Python310\site-packages\hyfetch\main.py", line 199, in create_config
    asc = get_distro_ascii()
  File "C:\Users\f191\AppData\Roaming\Python\Python310\site-packages\hyfetch\neofetch_util.py", line 150, in get_distro_ascii
    return normalize_ascii(check_output([get_command_path(), cmd]).decode().strip())
  File "C:\Program Files\Python310\lib\subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Program Files\Python310\lib\subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "C:\Program Files\Python310\lib\subprocess.py", line 966, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\Python310\lib\subprocess.py", line 1435, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
OSError: [WinError 193] %1 is not a valid Win32 application

MINGw64 (Git Bash): Colours entirely broken, ends in same error as before Error

Ver. 67915c3

Cloned from GH Moving to the dir and using python -m hyfetch Powershell, Command Prompt, MINGw64 (Git Bash):

Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "C:\Program Files\Python310\lib\runpy.py", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "C:\Program Files\Python310\lib\runpy.py", line 110, in _get_module_details
    __import__(pkg_name)
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\__init__.py", line 3, in <module>
    from . import main, constants
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\main.py", line 14, in <module>
    from .models import Config
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\models.py", line 9, in <module>
    from .neofetch_util import ColorAlignment
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\neofetch_util.py", line 17, in <module>
    import psutil
ModuleNotFoundError: No module named 'psutil'
hykilpikonna commented 2 years ago

Oh sorry, I forgot to add psutil to the list of dependencies :cry:

I just added psutil dependency for windows-specific users in commit https://github.com/hykilpikonna/hyfetch/commit/a8352d1fef81f0337b576af6f6eb5988b56d1a2e.

Can you try python -m hyfetch again after installing psutil with pip install psutil?

comradef191 commented 2 years ago

Updated repo and installed psutil, Powershell:

/c/Users/f191/Desktop/hyfetch/hyfetch/scripts/neowofetch: line 1: ../../neofetch: No such file or directory
Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\__main__.py", line 4, in <module>
    main.run()
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\main.py", line 364, in run
    config = check_config()
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\main.py", line 34, in check_config
    return create_config()
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\main.py", line 87, in create_config
    asc = get_distro_ascii()
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\neofetch_util.py", line 233, in get_distro_ascii
    return normalize_ascii(run_command(cmd, True))
  File "C:\Users\f191\Desktop\hyfetch\hyfetch\neofetch_util.py", line 211, in run_command
    return check_output(full_cmd).decode().strip()
  File "C:\Program Files\Python310\lib\subprocess.py", line 420, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "C:\Program Files\Python310\lib\subprocess.py", line 524, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '[WindowsPath('C:/Program Files/Git/bin/bash.exe'), '-c', '/c/Users/f191/Desktop/hyfetch/hyfetch/scripts/neowofetch print_ascii']' returned non-zero exit status 127.

Command Prompt Terminal outputs cmd.exe doesn't support RGB colors, restarting in MinTTY...; Window briefly pops up before closing

hykilpikonna commented 2 years ago

Hmm... exit code 127 probably means that bash was launched but it can't find /c/Users/f191/Desktop/hyfetch/hyfetch/scripts/neowofetch

Oh right, hyfetch/hyfetch/scripts/neowofetch is actually symbolically linked to ../../neofetch, but windows doesn't support symbolic links, so it created a text file containing the path instead.

image

I don't know how to detect regular files that are supposed to be symbolic links in python yet, so I'll hard-code the link for now:

image

This should work, can you pull the latest repo and try again?

comradef191 commented 2 years ago

WhooaAH Doesnt break with an error now but holy FUCK colours are just broke. Coloursbroke1 coloursbroke2

comradef191 commented 2 years ago

oh hey you can actually complete the entire thing

CursedHyfetch

holy fuck this is cursed lmao

hykilpikonna commented 2 years ago

Lol that's so weird

I'll look into this on a Windows 10 vm tomorrow

slackingfred commented 1 year ago

I am also unable to run it on Windows (11, 22621.819). It exits with ModuleNotFoundError: No module named 'termios'

leohearts commented 1 year ago

same error with @slackingfred .

Screenshot_20221123_034135

hykilpikonna commented 1 year ago

same error with @slackingfred .

  • OS: Python 3.11.0
  • OS Version: Windows 10.0.22000 N/A Build 22000
  • pip 22.3

Thanks for reporting the issue! Should be fixed now.

image
slackingfred commented 1 year ago

It still doesn't run, either on Windows Terminal or Git Bash.

The error has changed, though: subprocess.CalledProcessError: Command '[WindowsPath('C:/Program Files/Git/bin/bash.exe'), '-c', '/c/Users/<redacted>/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0/LocalCache/local-packages/Python38/site-packages/neofetch print_ascii']' returned non-zero exit status 127.

Looks like the installation script didn't create the directory structure expected by neofetch_util.

hykilpikonna commented 1 year ago

It still doesn't run, either on Windows Terminal or Git Bash.

The error has changed, though: subprocess.CalledProcessError: Command '[WindowsPath('C:/Program Files/Git/bin/bash.exe'), '-c', '/c/Users/<redacted>/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0/LocalCache/local-packages/Python38/site-packages/neofetch print_ascii']' returned non-zero exit status 127.

Looks like the installation script didn't create the directory structure expected by neofetch_util.

127 means command not found or not executable... is your git bash installed at C:/Program Files/Git/bin/bash.exe?

hykilpikonna commented 1 year ago

Or can you check if /c/Users/<redacted>/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0/LocalCache/local-packages/Python38/site-packages/neofetch exists and is executable? Thanks

slackingfred commented 1 year ago

Or can you check if /c/Users/<redacted>/AppData/Local/Packages/PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0/LocalCache/local-packages/Python38/site-packages/neofetch exists and is executable? Thanks

Git Bash is at C:/Program Files/Git/bin/bash.exe, but neofetch script does not exist.

There are two neowofetch files found, but they both point to ../../neofetch which is nonexistent:

%localappdata%/Packages/PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0/LocalCache/local-packages/Python38/Scripts/neowofetch
%localappdata%/Packages/PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0/LocalCache/local-packages/Python38/site-packages/hyfetch/scripts/neowofetch

Looks like the setup script is somewhat incompatible with Store-installed Python...

hykilpikonna commented 1 year ago

Git Bash is at C:/Program Files/Git/bin/bash.exe, but neofetch script does not exist.

There are two neowofetch files found, but they both point to ../../neofetch which is nonexistent:

%localappdata%/Packages/PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0/LocalCache/local-packages/Python38/Scripts/neowofetch
%localappdata%/Packages/PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0/LocalCache/local-packages/Python38/site-packages/hyfetch/scripts/neowofetch

Looks like the setup script is somewhat incompatible with Store-installed Python...

As it turns out, different versions/implementations of python package/install script files to different locations (as reported in #84 where their installed version expanded the symlink). I've added multiple checks and hope they should cover all possible paths.

image