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

Help! #246

Closed
matthewcampbell10 opened this issue Aug 7, 2017 · 18 comments
Closed

Help! #246

matthewcampbell10 opened this issue Aug 7, 2017 · 18 comments

Comments

@matthewcampbell10
Copy link

Help. No matter what I do I cant get this to install. Can anyone help me?

The errors I keep getting at around running the top-ten-qbs and nfldb update scripts

If you run into any kind of trouble while trying to get nfldb installed, please open a new issue on nfldb's issue tracker. If you're thinking, "I'm not sure if this belongs on an issue tracker..." then my answer to you is: "Yes it does! Post it!" Not only does it help me stay organized, but it benefits others that come after you who run into similar problems

@ochawkeye
Copy link
Contributor

Need some details.

@matthewcampbell10
Copy link
Author

I think I would have to share screen. A lot of this is new to me and I have run through the windows install instructions many times. Cant seem to get to work.

@matthewcampbell10
Copy link
Author

C:\Python27\Scripts> "C:\Users\Matthew Campbell\Desktop\Python Scripts NFLDB\top-ten-qbs.py"

When I run this it just pops open the txt file

@ochawkeye
Copy link
Contributor

Because you don't have .py files associated with Python on your PC.

Try running python "C:\Users\Matthew Campbell\Desktop\Python Scripts NFLDB\top-ten-qbs.py"

@matthewcampbell10
Copy link
Author

C:\Users\Matthew Campbell\Desktop\Python Scripts NFLDB>python "C:\Users\Matthew Campbell\Desktop\Python Scripts NFLDB\top-ten-qbs.py"
Traceback (most recent call last):
File "C:\Users\Matthew Campbell\Desktop\Python Scripts NFLDB\top-ten-qbs.py", line 3, in
db = nfldb.connect()
File "C:\Python27\lib\site-packages\nfldb\db.py", line 140, in connect
set_timezone(conn, timezone)
File "C:\Python27\lib\site-packages\nfldb\db.py", line 182, in set_timezone
c.execute('SET timezone = %s', (timezone,))
File "C:\Python27\lib\site-packages\psycopg2\extras.py", line 249, in execute
return super(RealDictCursor, self).execute(query, vars)
psycopg2.DataError: invalid value for parameter "TimeZone": "US/Pacific
The name of the PostgreSQL database containing NFL data."

@matthewcampbell10
Copy link
Author

Looks like maybe an issue with timezone parameter?

@ochawkeye
Copy link
Contributor

ochawkeye commented Aug 7, 2017

What does your config.ini look like (from step 12 in the Windows install instructions? (On my machine this is located in D:\Python27\share\nfldb\config.ini)

I'm US/Central, but I do notice in the samples that both US/Pacific and US/Pacific-New are options.

@matthewcampbell10
Copy link
Author

I changed password to xxxx but I have the nfldb password I set up in there

@ochawkeye
Copy link
Contributor

Did you happen to remove the # sign from the next line in that file by any chance?

timezone = US/Central

# The name of the PostgreSQL database containing NFL data.
database = nfldb

@matthewcampbell10
Copy link
Author

Possibly. Let me try that

@ochawkeye
Copy link
Contributor

ochawkeye commented Aug 7, 2017

By the way, when copying & pasting code, if you "fence" the block between three tick marks ( ``` : SHIFT+~) it will be much more readable on github.

```
Your code here
```
results in:

Your code here

@matthewcampbell10
Copy link
Author

Good to know! I appreciate it! I am a rookie. One last question well I have you being so generous to help out. What's the best way to learn how to write different queries? I see I can somewhat follow the syntax in the top-ten qbs scrips but I am not really sure what I am doing.

Much appreciate the assistance!

@matthewcampbell10
Copy link
Author

matthewcampbell10 commented Aug 7, 2017

testing

[pgsql]
# The time zone to use in the PostgreSQL session by default.
# You can see a list of available time zone names with the following query:
# 
#     select * from pg_timezone_names
#
# Here are some common ones:
#
#    US/Alaska
#    US/Samoa
#    US/Hawaii
#    US/Mountain
#    US/Indiana-Starke
#    US/Pacific
#    US/Central
#    US/Michigan
#    US/Aleutian
#    US/East-Indiana
#    US/Arizona
#    US/Eastern
#    US/Pacific-New
#
# Datetimes are always stored as UTC, but this time zone setting
# can be used to change how datetimes are returned in SELECT queries.
timezone = US/Pacific

#The name of the PostgreSQL database containing NFL data.
database = nfldb

# The username and password for the database specified above.
# The user should have permission to add, delete and remove data.
# Also, the user should have permission to create/alter/drop tables,
# indexes and types.
user = nfldb
password = xxx

# The host of the PostgreSQL server. When using a local database, this should
# be set to "localhost".
host = localhost

# The port that the PostgreSQL server is running on. It is set to the
# default port of 5432.
port = 5432

@matthewcampbell10
Copy link
Author

the # was the problem!

@ochawkeye
Copy link
Contributor

ochawkeye commented Aug 7, 2017

The wiki has a ton of examples here, here, here, and here.

If there's something in particular you're looking for, I would try running a search on this issue tracker with some keywords. If that still fails don't hesitate to ask and someone will most likely be able to assist.

FYI - you are using apostrophes ' and not tick marks `

@matthewcampbell10
Copy link
Author

Think I fixed it. Thanks again for all your help

@ghost
Copy link

ghost commented Aug 18, 2017

I don't know how to like make an issue on this but I really need help on something so can someone please help me

@ochawkeye
Copy link
Contributor

Yep

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

2 participants