Forums

[Errno 2] No such file or directory: 'client_secrets.json'

Getting an error not finding a file that exists in my application home directory. Anyone got around this error?

Below is log 2016-05-02 03:22:46 [Errno 2] No such file or directory: 'client_secrets.json' 2016-05-02 03:22:46 2016-05-02 03:22:46 Traceback (most recent call last): 2016-05-02 03:22:46 File "/bin/user_wsgi_wrapper.py", line 154, in call 2016-05-02 03:22:46
2016-05-02 03:22:46 app_iterator = self.app(environ, start_response) 2016-05-02 03:22:46 File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application 2016-05-02 03:22:46
2016-05-02 03:22:46 raise e 2016-05-02 03:22:46 IOError

Solved this by setting an absolute path to the file .

Cool. Glad you worked it out.

Just a question. I have to modify the .json files and the database link everytime I add new features to the website as my local machine has a different path. Its a windows path , instead of the actual unix filesystem. Is there anyway to over-come this?

In the python file where you are accessing your json file, you could get the __file__, and then from there produce an absolute path to the json file using os.path standard libaray in python2 (or even the pathlib library for python3)

we have a help page on no such file or directory and absolute/relative paths now..

This was useful for me. thanks.

Useful for me too! Thank you.