pg_config is required to build psycopg2 from source. please add the directorycontaining pg_config to the $path or specify the full executable path with theoption: code example
Example: Error: pg_config executable not found.
sudo apt-get install libpq-dev python-dev