Pivotal Knowledge Base

Follow

gpload Unable to Import the PyGreSQL Python Module (pg.py)

Environment

  • Pivotal Greenplum Database (GPDB) 4.3.x
  • Operating System- Red Hat Enterprise Linux (RHEL) 6.x

Symptom

When gpload is installed on a new system, and the following error is displayed, saying python modules are missing, this resolution should help.

Error Message

gpload.py -v 
gpload was unable to import The PyGreSQL Python module (pg.py) - No module named pygresql

Cause 

Most likely, the greenplum_loaders_path has not been sourced correctly.

Resolution

1. Find the greenplum_loader_path.sh

find / -name greenplum_loaders_path.sh
/usr/local/greenplum-loaders-4.3.8.1-build-1/greenplum_loaders_path.sh

2. Source the greenplum_loaders_path.sh file

source /usr/local/greenplum-loaders-4.3.8.1-build-1/greenplum_loaders_path.sh

Additional Information 

After sourcing the path, there may be further errors such as:

'import site' failed; use -v for traceback 
gpload needs pyyaml.

This may be caused by other incorrect configurations in the user environment. Some troubleshooting steps to help resolve this include:

  • Review the .bashrc script for the user and look for different python paths that may be loaded.
  • Create a new Linux user, log in as that user, source the greenplum_loaders_path.sh file and try again. 

 

Comments

Powered by Zendesk