0

I'm trying to connect to Hadoop (HDFS) using Python. I'm using snakebite package for establishing connection. I installed it successfully, but when I'm trying to import it, it gives error as follows:

from snakebite.client import Client
client = Client('localhost', 9000)

Error:

File "C:\pythonNJ\lib\site-packages\snakebite\client.py", line 1473 baseTime = min(time * (1L << retries), cap);

Is there a way to solve it or can someone please tell me how to establish connection by another way?

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
David
  • 366
  • 3
  • 22

2 Answers2

1

From its README:

Snakebite requires python2 (python3 is not supported yet)

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
  • Thank you so much Chris, can you recommend me any better package alternative to Snakebite for hadoop connection in Python 3. – David Apr 03 '19 at 11:06
  • @David, software recommendations are off-topic here and I'm not very experienced with Hadoop. But it looks like there are [some options](https://duckduckgo.com/?q=python+3+hadoop). Pick something and give it a try. Good luck! – ChrisGPT was on strike Apr 03 '19 at 11:08
1

A Python 3 fork has been created since then, snakebite-py3.

pip install snakebite-py3

Julian Drago
  • 719
  • 9
  • 23