Ubuntu: Tostring() has been removed. Please call tobytes() instead



Question:

I try to install Reddit on my ubuntu server but I get an error after "make" line.

Please see the all lines from the server.

[+] including definitions from Makefile.py  python setup.py build  Cannot find Baseplate. Skipping Thrift build.  running build  running build_py  running build_ext  python setup.py build_ext --inplace  # copy the .so files from cython into the source tree  Cannot find Baseplate. Skipping Thrift build.  running build_ext  copying build/lib.linux-x86_64-2.7/r2/lib/sgm.so -> r2/lib  copying build/lib.linux-x86_64-2.7/r2/lib/wrapped.so -> r2/lib  copying build/lib.linux-x86_64-2.7/r2/lib/db/_sorts.so -> r2/lib/db  copying build/lib.linux-x86_64-2.7/r2/lib/mr_tools/_mr_tools.so -> r2/lib/mr_tools  copying build/lib.linux-x86_64-2.7/r2/lib/utils/_utils.so -> r2/lib/utils  copying build/lib.linux-x86_64-2.7/r2/lib/utils/comment_tree_utils.so -> r2/lib/utils  copying build/lib.linux-x86_64-2.7/Cfilters.so ->   # see above  rm -f build/public/static/sprite-reddit.png build/public/static/reddit.css  python r2/lib/nymph.py build/public/static/css/reddit.less build/public/static/sprite-reddit.png > build/public/static/css/reddit.less.tmp  Traceback (most recent call last):    File "r2/lib/nymph.py", line 185, in <module>      print spritify(sys.argv[1], sys.argv[2])    File "r2/lib/nymph.py", line 178, in spritify      images = _load_spritable_images(css_filename)    File "r2/lib/nymph.py", line 94, in _load_spritable_images      image_hash = hashlib.md5(image.convert("RGBA").tostring()).hexdigest()    File "/usr/local/lib/python2.7/dist-packages/Pillow-3.2.0-py2.7-linux-x86_64.egg/PIL/Image.py", line 699, in tostring      "Please call tobytes() instead.")  Exception: tostring() has been removed. Please call tobytes() instead.  make: *** [build/public/static/reddit.css] Error 1  

It is not a bug of the script because I found some similar posting but is not applicable for me too. https://www.reddit.com/r/redditdev/comments/19ntpk/make_fails_buildpublicstaticredditcss_error_127/ and https://www.reddit.com/comments/26dasw/_/

Something are missing or is set wrong but I don't know what... Please help me to fix it.


Solution:1

The code needs an older version (before 3.0) of Pillow than the one you have (3.2.0).

Try to remove your manually installed Pillow from /usr/local/lib/python2.7/dist-packages/Pillow-3.2.0-py2.7-linux-x86_64.egg and install an older version instead.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »