jmoiron / speedparser

feedparser but faster and worse
MIT License
101 stars 20 forks source link

Does speedparser compatible with python 3.7? #18

Open XCanG opened 5 years ago

XCanG commented 5 years ago

I get import error while trying it importing:

>>> import speedparser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python\Python37\lib\site-packages\speedparser\__init__.py", line 1, in <module>
    from speedparser import parse
ImportError: cannot import name 'parse' from 'speedparser' (C:\Python\Python37\lib\site-packages\speedparser\__init__.py)

I've checked __init__.py and if change first line to from .speedparser import parse it will fix import error, however later it throw another error:

>>> import speedparser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python\Python37\lib\site-packages\speedparser\__init__.py", line 1, in <module>
    from .speedparser import parse
  File "C:\Python\Python37\lib\site-packages\speedparser\speedparser.py", line 19, in <module>
    import urlparse
ModuleNotFoundError: No module named 'urlparse'

And it's look like it python 2 module, at least there a few libraries: https://pypi.org/project/urlparse2/ https://pypi.org/project/urlparse3/ https://pypi.org/project/urlparse4/ but all of them only for python 2.

tedder commented 5 years ago

My PR (#16) hasn't been accepted after almost 3 years, but it patches this issue. Just put this in your requirements.txt (or pass to pip3 install) instead of "speedparser".

https://github.com/tedder/speedparser/archive/master.zip

You can literally put that URL in.

tedder commented 5 years ago

See also #13.

XCanG commented 5 years ago

Yes, it works.