To facilitate better answering of questions, if you have a question, please fill in the following info. Otherwise, please delete the template.
What I want to do
I am having the exact same problem as Python Insert script not working - I get the same error and I have the right version as noted in the original post - but I’m not even sure how to attempt to fix this. I’m using a default Ubuntu to test this all out.
txn = client.txn()
Create data.
p = {
… ‘name’: ‘Alice’,
… }
Run mutation.
txn.mutate(set_obj=p)
Traceback (most recent call last):
File “”, line 1, in
File “/home/dave/.local/lib/python3.8/site-packages/pydgraph/txn.py”, line 75, in mutate
req = self.create_request(mutations=[mutation], commit_now=commit_now)
File “/home/dave/.local/lib/python3.8/site-packages/pydgraph/txn.py”, line 197, in create_request
resp_format = api.Request.RespFormat.JSON
AttributeError: ‘EnumTypeWrapper’ object has no attribute ‘JSON’
Please list the high level idea of what you want to do
What I did
I tried installing protobuf, looking at pip to see if I can find a new one… I have version 21.3.0 (as in the original post). I’m using dgraph from docker (simple little test engine).
Please list the things you have tried.
Dgraph metadata
dgraph version
PASTE THE RESULTS OF dgraph version HERE.
Dgraph version : v21.03.0
Dgraph codename : rocket
Dgraph SHA-256 : b4e4c77011e2938e9da197395dbce91d0c6ebb83d383b190f5b70201836a773f
Commit SHA-1 : a77bbe8ae
Commit timestamp : 2021-04-07 21:36:38 +0530
I downloaded the latest git from github…clearly I’m doing something wrong though!
dave@dave-VirtualBox:~/pydgraph$ python3
Python 3.8.5 (default, May 27 2021, 13:30:53)
[GCC 9.3.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
import pydgraph
Traceback (most recent call last):
File “”, line 1, in
File “/home/dave/pydgraph/pydgraph/init.py”, line 17, in
from pydgraph.client_stub import *
File “/home/dave/pydgraph/pydgraph/client_stub.py”, line 102
“”“Returns Dgraph Client stub for the Slash GraphQL endpoint”“”
^
IndentationError: expected an indented block
Not sure, I use Darwin. I was hoping it was some simple mistake that making the test would guarantee that wasn’t nothing related to the env itself. As the tests are made for Linux env they should run fine. Also I think we use Ubuntu in our TC.