aboSamoor / polyglot

Multilingual text (NLP) processing toolkit
http://polyglot-nlp.com
Other
2.31k stars 337 forks source link

error when python setup.py #112

Closed visonforcoding closed 7 years ago

visonforcoding commented 7 years ago

$ python setup.py install Traceback (most recent call last): File "setup.py", line 14, in with open('README.rst', encoding="utf-8") as readme_file: TypeError: 'encoding' is an invalid keyword argument for this function

my python version is 2.7.

JafferWilson commented 7 years ago

You are using the Python 2.7 version. What you are trying is to open a file and read it. The syntax what you are trying is not permissible in Python 2. It belongs to python 3. The question might suit Stackoverflow.com Instead, the proper format for opening a file in Python 2 is something like this:

with open("README.rst","r") as data:
    text = data.read().encode("utf-8")

I hope this will help you. I will pull a request s that this issue is removed. You can close this issue if your query is resolved.