python simhash doesn't work on ubuntu -
I have the code to run the same setup and simshash on Mac, it works.
But when I
objs = [(str (k), simash (v))
in index_data.items () v, "file / / url /local/lib/python2.7/dist-packages/simhash-1.1.2-py2.7.egg/simhash/ < Strong> init .i ", line 30, in init self.build_by_text (Unicode (value)) Unicodecode error: 'ascii' codec can not decode byte 0xf6 in position 34: In the serial no category (128) The error tells you that str (k) is correctly Can not be decoded. Since I do not know where the data is coming from and what it really is, I can only say that or Let's assume that string cp At 850, at least I can do a And since it seems that there is a problem with the module, check that the string is used properly is already decoded properly.
str (k) .decode ('cp850')
Simhash (v.decode ('cp850')) Maybe
'\ xf6'.decode (' cp850 ') .
Comments
Post a Comment