Why "ImportError: No module named builtins" appears after importing hive from PyHive package?

I have a simple question to ask. I have been trying to execute HIVE queries from Python using impyla package. But I stuck into cursor problem, already a question has been asked on stackoverflow. In this question, a user answered and advised to use PyHive instead.

Therefore, now I am trying to execute HIVE queries from Python using PyHive. But unluckily, I am stuck at another issue which seems to be not that complicated. As soon as I execute the following line in python I get an error:

In [18]: from pyhive import hive
Traceback (most recent call last):

  File "<ipython-input-18-747088b97eb4>", line 1, in <module>
    from pyhive import hive

  File "build\bdist.win32\egg\pyhive\hive.py", line 13, in <module>

  File "build\bdist.win32\egg\pyhive\common.py", line 8, in <module>

ImportError: No module named builtins

Can anyone indicate where I am getting it wrong? Since, I have already successfully installed the PyHive package on my machine, so I don't expect this to appear. I have been searching allot to find a reason of this error. It will be really a great time saver if I know the solution today. Thank you very much for your time and support.

UPDATE

I am using:

  1. Windows 7 (64-bit)
  2. Python 2.7 (32-bit)
  3. Anaconda2 4.1.1 (32-bit)

Answers


In python 3 the module __builtin__ was renamed to builtins.

It is possible that you have installed a python 3 package and are trying to run it with python 2.


Need Your Help

How to determine if a PropertyType is foreign key

c# asp.net-mvc entity-framework foreign-keys html-helper

I have the following class 'schakeling', generated with EF, representing a database table 'schakeling'. In the database 'id' is the primary key and 'plc_id' is a foreign key.

Reuse or create new View/ViewModel for MDI tool windows

wpf mvvm mdi

In a MVVM MDI app with singleton tool windows (think of Visual Studio), the tool window contents change according to current selected document. There are 5 tool windows now and more to come.