mps-youtube / yewtube

yewtube, forked from mps-youtube , is a Terminal based YouTube player and downloader. No Youtube API key required.
GNU General Public License v3.0
8.07k stars 645 forks source link

SyntaxError in Development Branch on Windows #1094

Closed AyoungDukie closed 1 year ago

AyoungDukie commented 4 years ago

After installing the development version via the command linked in the FAQ, attempting to launch mps-youtube gives an error:

File "C:\Users\<USERNAME>\AppData\Roaming\Python\Python38\Scripts\mpsyt.exe", line 1 SyntaxError: Non-UTF-8 code starting with '\x90' in file C:\Users\<USERNAME>\AppData\Roaming\Python\Python38\Scripts\mpsyt.exe on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

Issue / Suggestion

mps-youtube fails to launch on windows via the development branch build. Rolling back to the current 0.2.8 release resolves the issue. **Edit:** As an additional note, I have been running the executable manually as a workaround to an issue that seems unique to windows for whatever reason. If I try running the "mpsyt" command instead (and similarly if I try running a new "mpsyt-script.py" file) the following is output instead: ` File "C:\Users\\AppData\Roaming\Python\Python38\Scripts\mpsyt-script.py", line 11, in load_entry_point('mps-youtube==0.2.8', 'console_scripts', 'mpsyt')() File "c:\users\\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "c:\users\\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 2852, in load_entry_point return ep.load() File "c:\users\\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 2443, in load return self.resolve() File "c:\users\\appdata\local\programs\python\python38-32\lib\site-packages\pkg_resources\__init__.py", line 2449, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\__init__.py", line 8, in init.init() File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\init.py", line 59, in init assign_player(config.PLAYER.get) # Player is not assigned when config is loaded File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\util.py", line 571, in assign_player module = import_module('mps_youtube.players.{0}'.format(module_name)) File "c:\users\\appdata\local\programs\python\python38-32\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\players\mpv.py", line 12, in from ..player import CmdPlayer File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\player.py", line 15, in from .commands import lastfm File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\commands\__init__.py", line 37, in from . import download, search, album_search, spotify_playlist, misc, config, local_playlist File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\commands\download.py", line 13, in from .search import yt_url, user_pls File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\commands\search.py", line 22, in from .songlist import plist, paginatesongs File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\commands\songlist.py", line 79, in @command(r'pl\s+%s' % PL, 'pl') File "C:\Users\\AppData\Roaming\Python\Python38\site-packages\mps_youtube\commands\__init__.py", line 28, in command completer.add_cmd(command) AttributeError: 'NoneType' object has no attribute 'add_cmd' ` ## Your Environment

mpsyt version : 0.2.8 notes : released 17 February 2018 pafy version : 0.5.5 (youtube-dl backend) youtube-dl version : 2020.05.29 Python version : 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] Processor : Intel64 Family 6 Model 45 Stepping 7, GenuineIntel Machine type : AMD64 Architecture : 64bit, WindowsPE Platform : Windows-10-10.0.18362-SP0 sys.stdout.enc : utf-8 default enc : utf-8 Config dir : C:\Users\<USERNAME>\AppData\Roaming\mps-youtube

iamtalhaasghar commented 1 year ago

Upgrade to latest version and let me know if issue still persists. I'll reopen it.