orakaro / rainbowstream

A smart and nice Twitter client on terminal written in Python.
https://github.com/orakaro/rainbowstream
MIT License
3.54k stars 260 forks source link

Fedora 33 #300

Open dabbill opened 3 years ago

dabbill commented 3 years ago

Unable to install on Fedora 33 Python 3.9.0

Tried to install as sudo, user, and in venv.

--> rainbowstream -iot Traceback (most recent call last): File "/home/dabbill/rainbowstream/venv/bin/rainbowstream", line 5, in from rainbowstream.rainbow import fly File "/home/dabbill/rainbowstream/venv/lib/python3.9/site-packages/rainbowstream/rainbow.py", line 25, in from .draw import File "/home/dabbill/rainbowstream/venv/lib/python3.9/site-packages/rainbowstream/draw.py", line 15, in from .c_image import File "/home/dabbill/rainbowstream/venv/lib/python3.9/site-packages/rainbowstream/c_image.py", line 5, in from .py3patch import * File "/home/dabbill/rainbowstream/venv/lib/python3.9/site-packages/rainbowstream/py3patch.py", line 11, in unescape = HTMLParser().unescape AttributeError: 'HTMLParser' object has no attribute 'unescape'

capaldo commented 3 years ago

Same issue on macOS Big Sur.

trb143 commented 3 years ago

Python 3.9 bug. Can be fixed by changing the py3patch.py file.

import sys

Library compatibility

if sys.version[0] == "2": from HTMLParser import HTMLParser from urllib2 import URLError else:

from html.parser import HTMLParser

from urllib.error import URLError
if sys.version_info[0] >= 3:
    import html
else:
    from six.moves import html_parser    
    html = html_parser.HTMLParser()

unescape = html.unescape

jrredhorse commented 3 years ago

@dabbill One reason your fix hasn't been merged is that the modification you submitted is different that what you show here. In fact, it's incorrect. Maybe double check it and try to re-submit your pull request?

dabbill commented 3 years ago

@jrredhorse I have removed my pull request. Looks like someone else submitted it correction with pull request #305

motatoes commented 3 years ago

Python 3.9 also failing on MacOS

Traceback (most recent call last):
  File "/Users/mohamedsayed/.pyenvs/py3/bin/rainbowstream", line 33, in <module>
    sys.exit(load_entry_point('rainbowstream', 'console_scripts', 'rainbowstream')())
  File "/Users/mohamedsayed/.pyenvs/py3/bin/rainbowstream", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/local/Cellar/python@3.9/3.9.0_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/mohamedsayed/rainbowstream/rainbowstream/rainbow.py", line 23, in <module>
    from .draw import *
  File "/Users/mohamedsayed/rainbowstream/rainbowstream/draw.py", line 15, in <module>
    from .c_image import *
  File "/Users/mohamedsayed/rainbowstream/rainbowstream/c_image.py", line 5, in <module>
    from .py3patch import *
  File "/Users/mohamedsayed/rainbowstream/rainbowstream/py3patch.py", line 11, in <module>
    unescape = HTMLParser().unescape
AttributeError: 'HTMLParser' object has no attribute 'unescape'
vectorcr commented 3 years ago

I am running into this same issue running Fedora 33. Can someone provide information on how to patch the py3patch.py that is mentioned by @trb143 ?

gorrioncillo commented 3 years ago

Python 3.9 bug. Can be fixed by changing the py3patch.py file.

import sys

Library compatibility

if sys.version[0] == "2": from HTMLParser import HTMLParser from urllib2 import URLError else:

from html.parser import HTMLParser

from urllib.error import URLError if sys.version_info[0] >= 3: import html else: from six.moves import html_parser html = html_parser.HTMLParser()

unescape = html.unescape

I try this fix but now I amfacing the following problem:

The system cannot find the path specified.
Traceback (most recent call last):
  File "C:\Users\pedro\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\pedro\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\pedro\pyVenvImp\Scripts\rainbowstream.exe\__main__.py", line 4, in <module>
  File "c:\users\pedro\pyvenvimp\lib\site-packages\rainbowstream\rainbow.py", line 25, in <module>
    from .draw import *
  File "c:\users\pedro\pyvenvimp\lib\site-packages\rainbowstream\draw.py", line 15, in <module>
    from .c_image import *
  File "c:\users\pedro\pyvenvimp\lib\site-packages\rainbowstream\c_image.py", line 25, in <module>
    rgb2short = call_c()
  File "c:\users\pedro\pyvenvimp\lib\site-packages\rainbowstream\c_image.py", line 21, in call_c
    image_c = ctypes.cdll.LoadLibrary(library)
  File "C:\Users\pedro\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "C:\Users\pedro\AppData\Local\Programs\Python\Python39\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'C:\Users\pedro\.image.so' (or one of its dependencies). Try using the full p
ath with constructor syntax.

I try to install on windows 10 with python 3.9 on a virtual environment (pyvenv).