kivy.atlas

41 views
Skip to first unread message

Allan Mabe

unread,
Jul 2, 2015, 6:35:51 PM7/2/15
to kivy-...@googlegroups.com
I am trying to use kivy.atlas to make an atlas of images, but I keep getting the following error:

python -m kivy.atlas myatlas 256x256 *.png
[INFO   ] [Logger      ] Record log in /home/ajmabe/.kivy/logs/kivy_15-07-02_9.txt
[INFO   ] [Kivy        ] v1.9.1-dev
[INFO   ] [Python      ] v3.4.3 (default, Mar 25 2015, 17:13:50) 
[GCC 4.9.2 20150304 (prerelease)]
 Traceback (most recent call last):
   File "/usr/lib/python3.4/runpy.py", line 170, in _run_module_as_main
     "__main__", mod_spec)
   File "/usr/lib/python3.4/runpy.py", line 85, in _run_code
     exec(code, run_globals)
   File "/usr/lib/python3.4/site-packages/kivy/atlas.py", line 442, in <module>
     ret = Atlas.create(outname, filenames, size, **options)
   File "/usr/lib/python3.4/site-packages/kivy/atlas.py", line 275, in create
     size_w = size_h = int(size)
 TypeError: int() argument must be a string, a bytes-like object or a number, not 'map'

What am I doing wrong here?

I am using arch linux and have python 3.4 installed by default, but I also have python 2 installed. I also installed the Pillow library. 

Alexander Taylor

unread,
Jul 2, 2015, 7:18:37 PM7/2/15
to kivy-...@googlegroups.com, allan...@gmail.com
Looks like this is a python3 bug - the code expects that map returns a list, but now it returns an object. I've created a PR (https://github.com/kivy/kivy/pull/3482) to fix this in the master branch.

In the meantime, it's probably easiest to make the atlas with python2 if you have that available, though you'd need kivy installed for that python. You could also modify the atlas source in the same way as my PR (it's just 2 small changes), I suppose that should have no bad side effects since when kivy is upgraded this fix will hopefully already have been merged.

Allan Mabe

unread,
Jul 3, 2015, 8:33:11 AM7/3/15
to kivy-...@googlegroups.com, allan...@gmail.com
Thanks, that worked out.
Reply all
Reply to author
Forward
0 new messages