scrapinghub / price-parser

Extract price amount and currency symbol from a raw text string
BSD 3-Clause "New" or "Revised" License
316 stars 50 forks source link

Getting error while installing the price-parser #25

Closed rpalsaxena closed 4 years ago

rpalsaxena commented 4 years ago

I wanted to contribute to this repo. Tried to install it manually using the python setup.py develop and python setup.py commands but it gave me errors.

image

rpalsaxena commented 4 years ago

I resolved this issue by making an edit in the setup.py. It works correctly on Linux OS. The error seems to occur only on Windows machine.

It got resolved by adding encoding="utf8" parameter.

    long_description=open('README.rst', encoding="utf8").read() + "\n\n" + open('CHANGES.rst').read(),
lopuhin commented 4 years ago

Thanks for investigating @rpalsaxena . Would you like to send a pull request with this fix?

rpalsaxena commented 4 years ago

I have created a pull request but there's another issue that I'm facing while importing it.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\rpals\Desktop\price-parser\price_parser\__init__.py", line 2, in <module>
    from .parser import Price, parse_price
  File "C:\Users\rpals\Desktop\price-parser\price_parser\parser.py", line 14
    amount: Optional[Decimal]   # price numeric value, as Decimal
          ^
SyntaxError: invalid syntax
lopuhin commented 4 years ago

This error seems to originate from a python version mismatch - priceparser requires python 3.6 or newer

rpalsaxena commented 4 years ago

You're right @lopuhin ! :)