voussoir / timesearch

The subreddit archiver
BSD 3-Clause "New" or "Revised" License
171 stars 7 forks source link

No module named 'bot4' #6

Closed WAUthethird closed 4 years ago

WAUthethird commented 4 years ago

When trying to use timesearch on latest source and up-to-date pip packages, I get the error in the title:

  File "timesearch.py", line 11, in <module>
    status_code = timesearch_modules.main(sys.argv[1:])
  File "C:\ProgramData\Anaconda3\envs\py36\lib\site-packages\voussoirkit\betterhelp.py", line 124, in wrapped
    return main(argv)
  File "D:\timesearch\timesearch_modules\__init__.py", line 423, in main
    args.func(args)
  File "D:\timesearch\timesearch_modules\__init__.py", line 342, in get_submissions_gateway
    from . import get_submissions
  File "D:\timesearch\timesearch_modules\get_submissions.py", line 4, in <module>
    from . import common
  File "D:\timesearch\timesearch_modules\common.py", line 22, in <module>
    import bot4
ModuleNotFoundError: No module named 'bot4'

Any way to fix this? I'm using Anaconda for env management.

voussoir commented 4 years ago

Hi, the bot.py file is meant to contain your reddit credentials. There is a part of the main readme that says this:

https://github.com/voussoir/timesearch#make-sure-you-have

  • Downloaded a copy of this file and saved it as bot.py. Fill out the variables using your OAuth information, and read the instructions to see where to put it. The Useragent is a description of your API usage. Typically "/u/username's praw client" is sufficient.

You can name it bot.py or bot4.py according to this logic.

The instructions inside bot.py describe the use of the PYTHONPATH env variable, but since you're using anaconda you may have to find a more specific directory to provide libs to your env. As always, placing the file in the same place as builtin modules like os or sys is guaranteed to work in a pinch.

WAUthethird commented 4 years ago

Seems to work, I actually deleted that file when upgrading to latest source, because I thought it was extraneous and unnecessary due to it utilizing timesearch. Too bad I didn't remember that it uses Reddit to check for the most up-to-date posts and comments.

Wasn't too hard to add back, though. Thanks!