cloudant / python-cloudant

A Python library for Cloudant and CouchDB
Apache License 2.0
163 stars 55 forks source link

Could not install package via pip #476

Closed pozzolana93 closed 4 years ago

pozzolana93 commented 4 years ago

Please read these guidelines before opening an issue.

Bug Description

When trying to install python-cloudant via pip, the installation fails:

Collecting cloudant
  Downloading cloudant-2.13.0.tar.gz (60 kB)
     |████████████████████████████████| 60 kB 5.2 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /home/simone/Documents/sl-couchdb/venv/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-RLoSst/cloudant/setup.py'"'"'; __file__='"'"'/tmp/pip-install-RLoSst/cloudant/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-BT2hBm
         cwd: /tmp/pip-install-RLoSst/cloudant/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-RLoSst/cloudant/setup.py", line 33, in <module>
        with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Installing version 2.12.0 works fine.

1. Steps to reproduce and the simplest code sample possible to demonstrate the issue

On python 2.7 run pip install cloudant

2. What you expected to happen

The python package should be installed

3. What actually happened

The installation fails

Environment details

Cloudant version = 2.13.0 Python version = 2.7.17

bessbd commented 4 years ago

Hi @pozzolana93 ,

Thank you for this ticket! According to https://www.python.org/doc/sunset-python-2/ , Python 2 is not supported since January 1, 2020. Can you please try installing python-cloudant on a recent Python 3 version and confirm if the issue still persists?

Thank you,

Donat

pozzolana93 commented 4 years ago

Hello, sorry for the late reply. The installation works fine on Python 3, but unfortunately I need to work with Python 2. The problem should be easy to fix, it's just due to the encoding argument while opening the README file. If you prefer to drop support to Python 2, just remove the compatibility with Python 2 and I will continue to use version 2.12.0 of the library.