twitter-photos icon indicating copy to clipboard operation
twitter-photos copied to clipboard

Unable to read credentials

Open rushirene opened this issue 8 years ago • 6 comments

Each time I try to open twphotos on the terminal I get the following message:

Traceback (most recent call last): File "/usr/local/bin/twphotos", line 7, in from twphotos.photos import main File "/usr/local/lib/python2.7/dist-packages/twphotos/photos.py", line 9, in from .settings import (CONSUMER_KEY, CONSUMER_SECRET, ACCESS_TOKEN, File "/usr/local/lib/python2.7/dist-packages/twphotos/settings.py", line 44, in raise Exception('No credentials found.') Exception: No credentials found.

I've already put the "credentials.ini"/"credentials.cfg" files inside the /twphotos folder and I still get the same error.

Am I doing something wrong?

rushirene avatar Nov 21 '16 22:11 rushirene

You don't need to create a directory. The config file itself is ~/.twphotos. For example:

$ cat ~/.twphotos
[credentials]
consumer_key = your_consumer_key
consumer_secret = your_consumer_secret
access_token_key = your_access_token_key
access_token_secret = your_access_token_secret

shichao-an avatar Nov 22 '16 07:11 shichao-an

Tried again, but the terminal tells me that there's not file or directory with that name. Btw, the program is installed in the root folder since I have full-disk encryption. Maybe it has something to do with it?

rushirene avatar Nov 24 '16 00:11 rushirene

Where is the .twphotos file located? It appears to be a hidden file but when i edit it to my consumer_keys I still get the same error as above.

Honowski avatar Nov 25 '16 21:11 Honowski

Well, tried everything. I downloaded VirtualBox to install the program in an unencrypted disk. Installed through pip, then tried the distribution and still nothing. There wasn't a .twphotos config file (like the test one in the distribution), so I moved the test file with the correct credentials into the unencrypted "twphotos" folder and it still didn't read the file.

I don't know what I'm doing wrong.

rushirene avatar Nov 26 '16 07:11 rushirene

I am facing exactly the same problem and would like to know the folder where this file is to be placed.

ajinkyakolhe avatar Mar 06 '17 11:03 ajinkyakolhe

@ajinkyakolhe the folder is your home folder. On Unix systems, it's identified by $HOME or ~ (tilde expansion), so the full path of the config file is something like /home/yourname/.twphotos on Linux and /Users/yourname/.twphotos on OS X. Note that .twphotos is a file in your home directory. You have to run twphotos as yourself, not as other users, so that twphotos can find your config file.

shichao-an avatar Mar 07 '17 23:03 shichao-an