seuss icon indicating copy to clipboard operation
seuss copied to clipboard

makeChains.py

Open billdred opened this issue 4 years ago • 2 comments

Hello,

I've been following your instructions for setting up this bot and keep getting syntax errors when trying to run makeChains.py almost entirely around missing parentheses in print calls, which I tried to remedy. This one has me stumped, as I'm not really strong in python syntax at all.

File "makeChains.py", line 48 deleteChainCache(sys.argv[1], "cache/")

If you could help me out I would really appreciate it, this really looks interesting to work with. The problem could be entirely user error. Everything up to this point has gone smoothly though.

Thank you,

-billdred

billdred avatar Mar 15 '20 15:03 billdred

You are likely running this on python3 when this code was clearly written for python2. Yes if that is the case you'll need to do a conversion, and you may have made an error while doing so.

TangerineCat avatar Mar 17 '20 10:03 TangerineCat

Thanks, I believe I was able to get to the same point using python 2 and received the following errors. I did successfully set up the database.

root@BilldredMachine:/home/billdred/seuss# python ./makeChains.py DJG Deleting old cache files Creating new cache files Traceback (most recent call last): File "./makeChains.py", line 51, in makeChain(sys.argv[1], "sources/", "cache/") File "./makeChains.py", line 13, in makeChain fwd = Markov.MarkovChain(cacheDir + name + "-fwd", 1, True) File "/home/billdred/seuss/Markov.py", line 13, in init writeback = wb) File "/usr/lib/python2.7/shelve.py", line 239, in open return DbfilenameShelf(filename, flag, protocol, writeback) File "/usr/lib/python2.7/shelve.py", line 223, in init Shelf.init(self, anydbm.open(filename, flag), protocol, writeback) File "/usr/lib/python2.7/anydbm.py", line 85, in open return mod.open(file, flag, mode) File "/usr/lib/python2.7/dbhash.py", line 18, in open return bsddb.hashopen(file, flag, mode) File "/usr/lib/python2.7/bsddb/init.py", line 364, in hashopen d.open(file, db.DB_HASH, flags, mode) bsddb.db.DBNoSuchFileError: (2, 'No such file or directory')

Thanks.

billdred avatar Mar 17 '20 14:03 billdred