Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error installing nfldb Python module #205

Open
keithfabean opened this issue Oct 25, 2016 · 3 comments
Open

Error installing nfldb Python module #205

keithfabean opened this issue Oct 25, 2016 · 3 comments

Comments

@keithfabean
Copy link

When I tried to install the Python module I'm getting the below error. I've searched my machine and do not have a pg_config file anywhere. I'm using the Postgres DB Mac app (Postgres v9.5.3.0)
the closest thing I've found is a postgresql.conf file in the Postgres data directory.

(complete results from the install command)
pip2 install --no-cache-dir nfldb

Collecting nfldb
Downloading nfldb-0.2.17.tar.gz (1.3MB)
100% |████████████████████████████████| 1.3MB 1.5MB/s
Collecting nflgame>=1.2.20 (from nfldb)
Downloading nflgame-1.2.20.tar.gz (34.0MB)
100% |████████████████████████████████| 34.0MB 9.4MB/s
Collecting psycopg2 (from nfldb)
Downloading psycopg2-2.6.2.tar.gz (376kB)
100% |████████████████████████████████| 378kB 2.6MB/s
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
warning: manifest_maker: standard file '-c' not found

Error: pg_config executable not found.

Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:

    python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/bb/ch562gmn17131gw8_d59bbkm0000gn/T/pip-build-JptrOC/psycopg2/

@UpNorthCoder
Copy link

Not sure but,
Try adding the path to your config file to "def config" in db.py .
For example to add 'C:\Python27\share\nfldb\config.ini')

def config(config_path=''):
paths = [
config_path,
path.join(sys.prefix, 'share', 'nfldb', 'config.ini'),
path.join(_config_home, 'nfldb', 'config.ini'),
'C:\Python27\share\nfldb\config.ini'
]

@keithfabean
Copy link
Author

keithfabean commented Nov 30, 2016 via email

@BurntSushi
Copy link
Owner

@keithfabean @D3Design's suggestion is unfortunately off the mark. (You don't have the directory structure that @D3Design showed because you haven't successfully installed nfldb.) The error message you're seeing is a result of not having the appropriate PostgreSQL libraries installed. Namely, just because you have PostgreSQL the app installed doesn't mean you have the necessary libraries to write programs against it. Unfortunately, I'm not a mac user so I don't know what the proper path is for getting the necessary libraries. On Linux distros, this is usually the part where you install something like postgresql-dev or libpq-dev or similar.

Or am I barking up the wrong tree here and need to find a different source for the NFL game data?

You're not barking up the wrong tree. nfldb is a bog-standard Python module that makes bog-standard use of PostgreSQL. Unfortunately, bog-standard use of PostgreSQL in Python-land means using a C library, and using a C library means you need to figure out how such things are installed on your platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants