https://cwiki.apache.org/confluence/display/Hive/HiveClient#HiveClient-Python appears to be outdated.
When I add this to /etc/profile:
export PYTHONP
here's a generic approach which makes it easy for me because I keep connecting to several servers (SQL, Teradata, Hive etc.) from python. Hence, I use the pyodbc connector. Here's some basic steps to get going with pyodbc (in case you have never used it):
Once complete:
STEP 1. pip install:
pip install pyodbc
(here's the link to download the relevant driver from Microsoft's website)
STEP 2. now, import the same in your python script:
import pyodbc
STEP 3. Finally, go ahead and give the connection details as follows:
conn_hive = pyodbc.connect('DSN = YOUR_DSN_NAME , SERVER = YOUR_SERVER_NAME, UID = USER_ID, PWD = PSWD' )
The best part of using pyodbc is that I have to import just one package to connect to almost any data source.