Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

TypeError: 'dict' object is not callable #21

Closed
cosemansbert opened this issue Nov 18, 2015 · 2 comments
Closed

TypeError: 'dict' object is not callable #21

cosemansbert opened this issue Nov 18, 2015 · 2 comments

Comments

@cosemansbert
Copy link

I've built acmd from source, and most of the commands fail with 'TypeError: 'dict' object is not callable'

09:10:52|vagrant@author1:~ 0 $ acmd bundles list
Traceback (most recent call last):
File "/usr/local/bin/acmd", line 5, in
pkg_resources.run_script('aem-cmd==0.6', 'acmd')
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/aem_cmd-0.6-py2.7.egg/EGG-INFO/scripts/acmd", line 7, in
main(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/aem_cmd-0.6-py2.7.egg/acmd/main.py", line 82, in main
status = run(options, config, args, cmdargs)
File "/usr/local/lib/python2.7/dist-packages/aem_cmd-0.6-py2.7.egg/acmd/main.py", line 50, in run
return cmd.execute(server, cmdargs)
File "/usr/local/lib/python2.7/dist-packages/aem_cmd-0.6-py2.7.egg/acmd/tools/bundles.py", line 28, in execute
return list_bundles(server, options)
File "/usr/local/lib/python2.7/dist-packages/aem_cmd-0.6-py2.7.egg/acmd/tools/bundles.py", line 52, in list_bundles
bundles = get_bundle_list(server)
File "/usr/local/lib/python2.7/dist-packages/aem_cmd-0.6-py2.7.egg/acmd/tools/bundles.py", line 47, in get_bundle_list
bundles = response.json()['data']
TypeError: 'dict' object is not callable

The system i'm using is debian wheezy with the following python packages installed:
09:10:59|vagrant@author1:~ 0 $ dpkg -l | grep python
ii libpython2.7 2.7.3-6+deb7u2 amd64 Shared Python runtime library (version 2.7)
ii python 2.7.3-4+deb7u1 all interactive high-level object-oriented language (default version)
ii python-apt 0.8.8.2 amd64 Python interface to libapt-pkg
ii python-apt-common 0.8.8.2 all Python interface to libapt-pkg (locales)
ii python-chardet 2.0.1-2 all universal character encoding detector
ii python-crypto 2.6-4+deb7u3 amd64 cryptographic algorithms and protocols for Python
ii python-debian 0.1.21 all Python modules to work with Debian-related data formats
ii python-debianbts 1.11 all Python interface to Debian's Bug Tracking System
ii python-fpconst 0.7.2-5 all Utilities for handling IEEE 754 floating point special values
ii python-gevent 0.13.6-1+nmu3 amd64 gevent is a coroutine-based Python networking library
ii python-greenlet 0.3.1-2.5 amd64 Lightweight in-process concurrent programming
ii python-lxml 2.3.2-1+deb7u1 amd64 pythonic binding for the libxml2 and libxslt libraries
ii python-minimal 2.7.3-4+deb7u1 all minimal subset of the Python language (default version)
ii python-oauthlib 0.1.2-1 all generic, spec-compliant implementation of OAuth for Python
ii python-pkg-resources 0.6.24-1 all Package Discovery and Resource Access using pkg_resources
ii python-reportbug 6.4.4+deb7u1 all Python modules for interacting with bug tracking systems
ii python-requests 0.12.1-1+deb7u1 all elegant and simple HTTP library for Python, built for human beings
ii python-setuptools 0.6.24-1 all Python Distutils Enhancements (setuptools compatibility)
ii python-six 1.1.0-2 all Python 2 and 3 compatibility library (Python 2 interface)
ii python-soappy 0.12.0-4 all SOAP Support for Python
ii python-support 1.0.15 all automated rebuilding support for Python modules
ii python2.6 2.6.8-1.1 amd64 Interactive high-level object-oriented language (version 2.6)
ii python2.6-minimal 2.6.8-1.1 amd64 Minimal subset of the Python language (version 2.6)
ii python2.7 2.7.3-6+deb7u2 amd64 Interactive high-level object-oriented language (version 2.7)
ii python2.7-minimal 2.7.3-6+deb7u2 amd64 Minimal subset of the Python language (version 2.7)

@bjorns
Copy link
Owner

bjorns commented Jan 5, 2016

Thanks,

So from the stacktrace it looks like the requests.json is a dict for you and a function that returns a dict for me.

I'm not sure the versioning is the same but in requirements.txt I have put:

requests==2.7.0

and in your list I see:

 python-requests 0.12.1-1+deb7u1 all elegant and simple HTTP library for Python, built for human beings

Which is a considerably lower version. Could you check which precise version of the requests library you are using and if possible try to upgrade it to 2.7.

@bjorns
Copy link
Owner

bjorns commented Jan 5, 2016

Here it is, it changed between 0.X and 1.X: http://docs.python-requests.org/en/latest/api/#migrating-to-1-x

@bjorns bjorns closed this as completed Jan 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants