Comments (10)
In case anyone runs into this in the future, this is probably due to you installing the wrong benedict module. Instead of:
pip install benedict
you should run:
pip install python-benedict
from python-benedict.
Check how you import it.
I think you are doing:
import benedict
instead of:
from benedict import benedict
from python-benedict.
I did originally have that mistake, yes! However here's the whole file: (the traceback is the same of course)
from benedict import benedict
d = benedict()
d['profile', 'firstname'] = 'Fabio'
print(d)
from python-benedict.
I don’t think the traceback is the same, could you check it please?
from python-benedict.
Sure thing!
Traceback (most recent call last):
File "/home/hagfelsh/.PyCharmCE2019.3/config/scratches/benedict-test.py", line 3, in <module>
d = benedict()
TypeError: 'module' object is not callable
Process finished with exit code 1
In pycharm there are some deeper parts of the traceback. I'm new to python so I'm not sure what in here is valuable. Here are some that look like they might be:
exception/type/args = {getset_descriptor} <attribute 'args' of 'BaseException' objects>
traceback_frame/stack[4] = 'frame: <module> [pydevd.py:2127] id:35889816'
from python-benedict.
I don't think this is a library problem, this snipped of code works perfectly:
from benedict import benedict
d = benedict()
d['profile', 'firstname'] = 'Fabio'
print(d)
and prints:
{'profile': {'firstname': 'Fabio'}}
from python-benedict.
Well that's interesting! I wonder what's wrong in my environment! I'll cook up a new venv and try it there. Thanks for such fast responses :)
from python-benedict.
Ok, don't worry! If you find any bug please provide also a failing test case to speed up bug fixing.
from python-benedict.
All possible working solution at [Solved] TypeError: ‘module’ object is not callable
from python-benedict.
@mthbrown thanks for clarifying the issue, it will surely be useful to someone else.
from python-benedict.
Related Issues (20)
- Add possibility to access items using keys as attributes (dotted notation).
- Protected keys in JSON items after calling json.dumps on benedict HOT 7
- Missing dependency on pyyaml HOT 3
- keyattr dynamic or AttributeError HOT 5
- INI support for case sensitive keys HOT 6
- `from_ini()` returns a `str` instead of a `dict` HOT 21
- Support defining how input data is loaded (filepath, url or data-string) HOT 3
- Assigning benedict element to itself clears the element HOT 2
- Minimalize dependencies and define scope HOT 1
- Move some requirements to a new `parse` extra requirement.
- Exception when comparing with Protocol classes HOT 7
- Yaml serializer produces inconsistent results HOT 5
- Add `from_html` method. HOT 2
- iterating benedict_dictionary.items(), value is not benedict_type HOT 2
- Union with assignment operator produces inconsistent results compared to `dict`. HOT 2
- README Index links don't work on PyPI, only GitHub's markdown renderer HOT 2
- Bug: Passing `data_only=True` into `from_xls()` returns excel formulas instead of cell data values HOT 5
- RecursionError while initializing from existing dict HOT 3
- Optionally allow `keypath_separator` in input dict keys (`unflatten`). HOT 6
- Benedict with Realtime Sync accross Processes HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-benedict.