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

IOError: Could not find valid configuration file ... file is in one of the paths tried #108

Open
dhodson opened this issue Oct 7, 2015 · 3 comments

Comments

@dhodson
Copy link

dhodson commented Oct 7, 2015

So I am to the point of checking if everything is working by running the short QB query and can't seem to get this to work. I have tried nuking the whole thing and starting over multiple times to no avail. Output is below.

I am using anaconda with 2.7, trying to run this in Spyder IDE. Very new to programming in general so apologies if I have left out information needed. I also don't seem to have the config.ini.sample file, just a config.ini which i did update with the proper password and it is in the path "C:\Anaconda\share\nfldb\config.ini"

Python 2.7.10 |Anaconda 2.3.0 (64-bit)| (default, May 28 2015, 16:44:52) [MSC v.1500 64 bit (AMD64)]
Type "copyright", "credits" or "license" for more information.

IPython 3.2.0 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http:https://continuum.io/thanks and https://anaconda.org
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
%guiref -> A brief reference about the graphical user interface.

In [1]: runfile('C:/Users/dohod_000/.spyder2/temp.py', wdir='C:/Users/dohod_000/.spyder2')
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/dohod_000/.spyder2/temp.py', wdir='C:/Users/dohod_000/.spyder2')

File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
execfile(filename, namespace)

File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/dohod_000/.spyder2/temp.py", line 9, in
db = nfldb.connect()

File "C:\Anaconda\lib\site-packages\nfldb\db.py", line 119, in connect
"Tried the following paths: %s" % tried)

IOError: Could not find valid configuration file. Tried the following paths: ['', 'C:\Anaconda\share\nfldb\config.ini', 'nfldb\config.ini']

In [2]: runfile('C:/Users/dohod_000/.spyder2/temp.py', wdir='C:/Users/dohod_000/.spyder2')
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/dohod_000/.spyder2/temp.py', wdir='C:/Users/dohod_000/.spyder2')

File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
execfile(filename, namespace)

File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/dohod_000/.spyder2/temp.py", line 9, in
db = nfldb.connect()

File "C:\Anaconda\lib\site-packages\nfldb\db.py", line 119, in connect
"Tried the following paths: %s" % tried)

IOError: Could not find valid configuration file. Tried the following paths: ['', 'C:\Anaconda\share\nfldb\config.ini', 'nfldb\config.ini']

In [3]: %clear

In [4]: runfile('C:/Users/dohod_000/.spyder2/temp.py', wdir='C:/Users/dohod_000/.spyder2')
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/dohod_000/.spyder2/temp.py', wdir='C:/Users/dohod_000/.spyder2')

File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
execfile(filename, namespace)

File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/dohod_000/.spyder2/temp.py", line 9, in
db = nfldb.connect()

File "C:\Anaconda\lib\site-packages\nfldb\db.py", line 119, in connect
"Tried the following paths: %s" % tried)

IOError: Could not find valid configuration file. Tried the following paths: ['', 'C:\Anaconda\share\nfldb\config.ini', 'nfldb\config.ini']

@dhodson
Copy link
Author

dhodson commented Oct 7, 2015

Think I got more attempts in that paste of output than I wanted, here is a more concise output with just one attempt:

runfile('C:/Users/dohod_000/.spyder2/temp.py', wdir='C:/Users/dohod_000/.spyder2')
Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/dohod_000/.spyder2/temp.py', wdir='C:/Users/dohod_000/.spyder2')

File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile
execfile(filename, namespace)

File "C:\Anaconda\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 71, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)

File "C:/Users/dohod_000/.spyder2/temp.py", line 9, in
db = nfldb.connect()

File "C:\Anaconda\lib\site-packages\nfldb\db.py", line 119, in connect
"Tried the following paths: %s" % tried)

IOError: Could not find valid configuration file. Tried the following paths: ['', 'C:\Anaconda\share\nfldb\config.ini', 'nfldb\config.ini']

@BurntSushi
Copy link
Owner

The error message means exactly what it says: it tried to open a config file at those paths and it couldn't. There's really nothing much else to say. The code that tries the paths is here: https://github.com/BurntSushi/nfldb/blob/master/nfldb/db.py#L47 And if nothing is found, it reports the error you're seeing, which is here: https://github.com/BurntSushi/nfldb/blob/master/nfldb/db.py#L116

I'd recommend double checking that you do in fact have a valid config file at one of the paths listed.

There is a config.ini.sample file here: https://github.com/BurntSushi/nfldb/blob/master/config.ini.sample

@dhodson
Copy link
Author

dhodson commented Oct 7, 2015

Figured it out, sorry for wasting any of your time and thanks for all the work with this!

For any newbs like myself that might be having trouble with this. I don't know if its a windows thing or just my lack of experience, but here was the issue:

When I made a copy of the config.ini file it was still under a .SAMPLE extension. I don't have much experience, so I didn't know that was a thing and really how to even fix it. I tried saving several different ways and specifying my own extension from notepad and it did not work, so I just started from scratch and copied and pasted the content of the sample file into a new document (not a copied one) then saved it properly as 'config.ini'.

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