Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue generating metadata.json on debian without python module simplejson #1

Open
autious opened this issue Aug 10, 2013 · 0 comments

Comments

@autious
Copy link

autious commented Aug 10, 2013

This is a minor issue, but these notes may help anyone that comes after me.

When running the script on a debian machine

Linux 3.2.0-4-amd64 #1 SMP Debian 3.2.46-1 x86_64 GNU/Linux

Using packaged python version 2.7.3

I get the following error:

Reading image resources
Packing 20 images to sprite-sheets
1.png 20 images was packed with pixel overhead of 24.19%
Traceback (most recent call last):
File "/usr/local/bin/art-packer", line 5, in
pkg_resources.run_script('artpacker==1.0.1', 'art-packer')
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 499, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1235, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.7/dist-packages/artpacker-1.0.1-py2.7.egg/EGG-INFO/scripts/art-packer", line 10, in
main()
File "/usr/local/lib/python2.7/dist-packages/artpacker-1.0.1-py2.7.egg/artpacker/cli.py", line 102, in main
verbose=options.verbose).generate()
File "/usr/local/lib/python2.7/dist-packages/artpacker-1.0.1-py2.7.egg/artpacker/artpacker.py", line 91, in generate
self.metadata_saver.save({'sheets': sprite_sheets, 'sprites': metadata})
File "/usr/local/lib/python2.7/dist-packages/artpacker-1.0.1-py2.7.egg/artpacker/metadata/json.py", line 14, in save
content = BANNER + json.dumps(metadata, indent=' ')
AttributeError: 'module' object has no attribute 'dumps'

Note the last line.

Installing the debian package python-simplejson turned out to be a quick way of fixing this issue for me.

From what i can gather from this post: http://stackoverflow.com/questions/11369734/python-json-module-has-no-attribute-dumps

The reason for the error might be the compounding circumstances of having a file named json.py and not having simplejson available thus falling back on the json module. This might result in that the json.py file gets loaded incorrectly due to its name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant