Beating Alpha

iterating towards truth

Uncategorized

pg_config missing in anaconda python3 env

Recently I have been buidling blocks of scans written in Python to automate my trading. Since I am using Mac Os X (10.9.4), I have come across the problem with different environments. Since I do not use single instance of Python, there comes a problem with installing psycopg2 to run a postgre database.

The problem was with the path to the pg_config since the normal syntax pip install psycopg2 did not work. The reason why it did not work was, that I did not run the installation in a block under one terminal. If you are encountering the same problem, use these commands:

PATH=$PATH:/Library/PostgreSQL/9.3/bin/
– set the location of pg_config file
– change “/Library/PostgreSQL/9.3/bin/” to your location of the postgre installation

anaconda/envs/py3k/bin/pip install psycopg2
– to install the psycopg2 for the right env of Python (py3k in my example), specify the location of your environment, if you would not do so, it would automatically install to your default python environmnt
– change “anaconda/envs/py3k/” for the location of your environment

Hope it helps.

Leave a Reply