taraslayshchuk / es2csv

Export from an Elasticsearch into a CSV file
Apache License 2.0
510 stars 191 forks source link

Can't install on Python 3.x #12

Closed lobetuf closed 7 years ago

lobetuf commented 7 years ago

Hi - Love using this on Python 2.7.x. But when I tried installing it for 3.5.x, I could not. Errors below - complaining about a missing 'HISTORY.rst'.

C:\WinPython-64bit-3.5.2.2Qt5\scripts>pip install es2csv
Collecting es2csv
  Downloading es2csv-1.0.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\AllUsers\AppData\Local\Temp\pip-build-wqb1vo1a\es2csv\setup.py", line 26, in <module>
        with open('HISTORY.rst') as history_file:
    FileNotFoundError: [Errno 2] No such file or directory: 'HISTORY.rst'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\AllUsers\AppData\Local\Temp\pip-build-wqb1vo1a\es2csv\

pip install git+https://github.com/taraslayshchuk/es2csv.git yields a similar outcome:

C:\WinPython-64bit-3.5.2.2Qt5\scripts>pip install git+https://github.com/taraslayshchuk/es2csv.git
Collecting git+https://github.com/taraslayshchuk/es2csv.git
  Cloning https://github.com/taraslayshchuk/es2csv.git to c:\users\AllUsers\appdata\local\temp\pip-v5g9qzta-build
Collecting elasticsearch>=2.3.0 (from es2csv==1.0.3)
  Downloading elasticsearch-2.4.0-py2.py3-none-any.whl (54kB)
    100% |################################| 61kB 119kB/s
Collecting progressbar>=2.3 (from es2csv==1.0.3)
  Cache entry deserialization failed, entry ignored
  Downloading progressbar-2.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\AllUsers\AppData\Local\Temp\pip-build-fetxalge\progressbar\setup.py", line 5, in <module>
        import progressbar
      File "C:\Users\AllUsers\AppData\Local\Temp\pip-build-fetxalge\progressbar\progressbar\__init__.py", line 59, in <module>
        from progressbar.widgets import *
      File "C:\Users\AllUsers\AppData\Local\Temp\pip-build-fetxalge\progressbar\progressbar\widgets.py", line 121, in <module>
        class FileTransferSpeed(Widget):
      File "C:\WinPython-64bit-3.5.2.2Qt5\python-3.5.2.amd64\lib\abc.py", line 133, in __new__
        cls = super().__new__(mcls, name, bases, namespace)
    ValueError: 'format' in __slots__ conflicts with class variable

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\AllUsers\AppData\Local\Temp\pip-build-fetxalge\progressbar\

Thanks, E

lobetuf commented 7 years ago

Ah - some progress. Looking at the dump above, then googling some, it seems there was an issue with Python 3 and progressbar. The following got around the issue, by grabbing progressbar from master, yielding the desired Successfully installed elasticsearch-2.4.0 es2csv-1.0.3 urllib3-1.18 message!

C:\WinPython-64bit-3.5.2.2Qt5\notebooks>pip install https://github.com/datalad/python-progressbar/archive/master.zip
Collecting https://github.com/datalad/python-progressbar/archive/master.zip
  Downloading https://github.com/datalad/python-progressbar/archive/master.zip
     \ 20kB 276kB/s
Installing collected packages: progressbar
  Running setup.py install for progressbar ... done
Successfully installed progressbar-2.3

C:\WinPython-64bit-3.5.2.2Qt5\notebooks>pip install git+https://github.com/taraslayshchuk/es2csv.git
Collecting git+https://github.com/taraslayshchuk/es2csv.git
  Cloning https://github.com/taraslayshchuk/es2csv.git to c:\users\AllUsers\appdata\local\temp\pip-ezprmpfy-build
Collecting elasticsearch>=2.3.0 (from es2csv==1.0.3)
  Using cached elasticsearch-2.4.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): progressbar>=2.3 in c:\winpython-64bit-3.5.2.2qt5\python-3.5.2.amd64\lib\site-packages (from es2csv==1.0.3)
Collecting urllib3<2.0,>=1.8 (from elasticsearch>=2.3.0->es2csv==1.0.3)
  Using cached urllib3-1.18-py2.py3-none-any.whl
Installing collected packages: urllib3, elasticsearch, es2csv
  Running setup.py install for es2csv ... done
Successfully installed elasticsearch-2.4.0 es2csv-1.0.3 urllib3-1.18
wivlaro commented 2 years ago

This workaround didn't work for me. I just get this at the end:

ERROR: Package 'es2csv' requires a different Python: 3.9.13 not in '==2.7.*'