rhiever / TwitterFollowBot

A Python bot that automates several actions on Twitter, such as following users and favoriting tweets.
GNU General Public License v3.0
1.31k stars 447 forks source link

IOError: [Errno 2] No such file or directory: 'config.txt' #60

Closed austkel closed 9 years ago

austkel commented 9 years ago

Getting the following error... image

I've edited my config file. It's in the same directory it came in. Any idea what I might be doing wrong?

austkel commented 9 years ago

The main folder for the TwitterFollowBot is in my C drive.

rhiever commented 9 years ago

You'll need to pass a string to the constructor with a path pointing to the config file, e.g., 'C:/TwitterFollowBot/config.txt'

By default, the script looks for a config.txt in the current directory you're running the script in.

austkel commented 9 years ago

Not entirely sure how to do what you described. Here's where my config.txt is...

image

rhiever commented 9 years ago

Change the line in your code to:

my_bot = TwitterBot('C:/TwitterFollowBot-master/config.txt')
austkel commented 9 years ago

Ok, I've now received this error. However, I've entered the details necessary. I tried it once before with including line breaks but that seemed to have caused an error. So now it's one long continuous string but the data is in the config.txt.

image

austkel commented 9 years ago

Thanks for your quick replies btw

rhiever commented 9 years ago

See here for how to fill out the config.txt: https://github.com/rhiever/TwitterFollowBot#configuring-the-bot

On Thu, Jul 23, 2015 at 4:52 PM, austkel notifications@github.com wrote:

Ok, I've now received this error. However, I've entered the details necessary. I tried it once before with including line breaks but that seemed to have caused an error. So now it's one long continuous string but the data is in the config.txt.

[image: image] https://cloud.githubusercontent.com/assets/13457575/8861923/c391e924-3152-11e5-8252-649d770d78b0.png

— Reply to this email directly or view it on GitHub https://github.com/rhiever/TwitterFollowBot/issues/60#issuecomment-124237047 .

Randal S. Olson, Ph.D. Postdoctoral Researcher, Institute for Biomedical Informatics University of Pennsylvania

E-mail: rso@randalolson.com | Twitter: @randal_olson https://twitter.com/randal_olson http://www.randalolson.com

austkel commented 9 years ago

I think I entered it properly, but then I get this message like I got previously...

screen

image

rhiever commented 9 years ago

Is there an empty line at the end of config.txt?

On Thu, Jul 23, 2015 at 5:05 PM, austkel notifications@github.com wrote:

I think I entered it properly, but then I get this message like I got previously...

[image: screen] https://cloud.githubusercontent.com/assets/13457575/8862235/a006178a-3154-11e5-8712-c394b12594d0.jpg

[image: image] https://cloud.githubusercontent.com/assets/13457575/8862247/b36e75f6-3154-11e5-90dd-96187cfbfa2d.png

— Reply to this email directly or view it on GitHub https://github.com/rhiever/TwitterFollowBot/issues/60#issuecomment-124240360 .

Randal S. Olson, Ph.D. Postdoctoral Researcher, Institute for Biomedical Informatics University of Pennsylvania

E-mail: rso@randalolson.com | Twitter: @randal_olson https://twitter.com/randal_olson http://www.randalolson.com

austkel commented 9 years ago

No

rhiever commented 9 years ago

Well, here's what's happening:

The script is trying to parse your config.txt file.

It's reaching a line in the file that it thinks it should parse and trying to split on the : token.

This line that it's parsing must not have a : in it because when it tries to grab the first item after the :, it reaches an index out of range error.

So there's something weird going on with the config.txt you're passing it.

xSLM commented 9 years ago

I have the same issue!

austkel commented 8 years ago

Revisted this program lately. I found that my issue was using Notepad. Try using something like Notepad++, paste in your config, you'll see all the weirdness. Fix it, paste it back in, boom.