Getting an error while setting up Snowflake connection on Arcadia 5.0 - "name 'dbapi2' is not defined"

When configuring your Snowflake connection on Arcadia Enterprise 5.0 you might see an error like this appear:

The root cause of this error is related to a library change for our Snowflake connector that may be missing during the install process. This has been corrected in later version of the product.

To resolve this error, you can pip install the snowflake-connector-python library manually in the on the host(s) running Arcadia Visualization Server. To do this you’ll need to first find the Python virtual environment (venv) that Arcadia Visualization Server is using.

On CDH, the path might look something like this:

source /opt/cloudera/parcels/ARCADIAENTERPRISE/lib/venv/bin/activate

On HDP, the path might look something like this:

source /opt/arcadia/lib/venv/bin/activate

After executing that command you should be inside the venv.

[root@myserver lib]# source venv/bin/activate
(venv) [root@ myserver lib]#

From here you can run pip list to see the packages installed currently with the Arcadia Visualization Server virtual environment. The snowflake-connector-python library should either be missing or not the right version if you’re see the error above.

To pip install the connector within the venv, run this command

pip install snowflake-connector-python

Now if you run pip list once again, you should see the library present.

Finally, restart the Arcadia Visualization Server and then retest connecting to your Snowflake cluster.

1 Like