-
Notifications
You must be signed in to change notification settings - Fork 975
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
TypeError: can't pickle CompiledFFI objects #397
Comments
Hi @benpowis apologies for my delayed response! At first glance I'm not sure what the exact problem is here. I've seen issues in the past related to packages specific to anaconda. Do you think you could paste the contents of running |
I'm getting the same error listing campaigns:
Here's the stack trace:
My installed libraries:
|
@BenRKarl Any updates on this issue? |
I think the problem is that _http inside googleapiclient.discovery.Resource is not registered as a dynamic_attr and as a result getstate does not delete it. |
I'm new to python and came across this too. I think it's a mismatch between the wiki documentation for JWT auth and the code. Once I changed to this, it started working: oauth2_client = oauth2.GoogleServiceAccountClient(
'my-file-name.json',
oauth2.GetAPIScope('adwords'),
'[email protected]' # optional
)
client = adwords.AdWordsClient(
'my-developer-token',
oauth2_client,
'my-app-name',
client_customer_id='###-###-####'
) |
Originally posted this on the group for the AdWords API, but have been redirected here.
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/adwords-api/5pDjjmSuWSE/3zeaZcBCAQAJ
I am trying to programmatically add/update user lists in AdWords, I;ve got to the code so far by following code examples in the docs, but when I try to create a list I get the error TypeError: can't pickle CompiledFFI objects, and I can't work out how to get around it!
And here is the full error:
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-43-797ee50d19e7> in <module> 5 }] 6 ----> 7 result = user_list_service.mutate(operations) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\googleads\common.py in MakeSoapRequest(*args) 1380 try: 1381 return soap_service_method( -> 1382 *packed_args, _soapheaders=soap_headers)['body']['rval'] 1383 except zeep.exceptions.Fault as e: 1384 error_list = () ~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\proxy.py in __call__(self, *args, **kwargs) 40 return self._proxy._binding.send( 41 self._proxy._client, self._proxy._binding_options, ---> 42 self._op_name, args, kwargs) 43 44 ~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\bindings\soap.py in send(self, client, options, operation, args, kwargs) 119 operation, args, kwargs, 120 client=client, --> 121 options=options) 122 123 response = client.transport.post_xml( ~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\bindings\soap.py in _create(self, operation, args, kwargs, client, options) 66 67 # Create the SOAP envelope ---> 68 serialized = operation_obj.create(*args, **kwargs) 69 self._set_http_headers(serialized, operation_obj) 70 ~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\definitions.py in create(self, *args, **kwargs) 198 199 def create(self, *args, **kwargs): --> 200 return self.input.serialize(*args, **kwargs) 201 202 def process_reply(self, envelope): ~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\messages\soap.py in serialize(self, *args, **kwargs) 61 # Create the soap:header element 62 headers_value = kwargs.pop('_soapheaders', None) ---> 63 header = self._serialize_header(headers_value, nsmap) 64 if header is not None: 65 envelope.append(header) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\wsdl\messages\soap.py in _serialize_header(self, headers_value, nsmap) 322 return 323 --> 324 headers_value = copy.deepcopy(headers_value) 325 326 soap = ElementMaker(namespace=self.nsmap['soap-env'], nsmap=nsmap) ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 148 copier = _deepcopy_dispatch.get(cls) 149 if copier: --> 150 y = copier(x, memo) 151 else: 152 try: ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _deepcopy_dict(x, memo, deepcopy) 238 memo[id(x)] = y 239 for key, value in x.items(): --> 240 y[deepcopy(key, memo)] = deepcopy(value, memo) 241 return y 242 d[dict] = _deepcopy_dict ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 159 copier = getattr(x, "__deepcopy__", None) 160 if copier: --> 161 y = copier(memo) 162 else: 163 reductor = dispatch_table.get(cls) ~\AppData\Local\Continuum\anaconda3\lib\site-packages\zeep\xsd\valueobjects.py in __deepcopy__(self, memo) 144 def __deepcopy__(self, memo): 145 new = type(self)() --> 146 new.__values__ = copy.deepcopy(self.__values__) 147 for attr, value in self.__dict__.items(): 148 if attr != '__values__': ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 178 y = x 179 else: --> 180 y = _reconstruct(x, memo, *rv) 181 182 # If is its own copy, don't memoize. ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 304 for key, value in dictiter: 305 key = deepcopy(key, memo) --> 306 value = deepcopy(value, memo) 307 y[key] = value 308 else: ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 178 y = x 179 else: --> 180 y = _reconstruct(x, memo, *rv) 181 182 # If is its own copy, don't memoize. ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 278 if state is not None: 279 if deep: --> 280 state = deepcopy(state, memo) 281 if hasattr(y, '__setstate__'): 282 y.__setstate__(state) ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 148 copier = _deepcopy_dispatch.get(cls) 149 if copier: --> 150 y = copier(x, memo) 151 else: 152 try: ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _deepcopy_dict(x, memo, deepcopy) 238 memo[id(x)] = y 239 for key, value in x.items(): --> 240 y[deepcopy(key, memo)] = deepcopy(value, memo) 241 return y 242 d[dict] = _deepcopy_dict ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 178 y = x 179 else: --> 180 y = _reconstruct(x, memo, *rv) 181 182 # If is its own copy, don't memoize. ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 278 if state is not None: 279 if deep: --> 280 state = deepcopy(state, memo) 281 if hasattr(y, '__setstate__'): 282 y.__setstate__(state) ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 148 copier = _deepcopy_dispatch.get(cls) 149 if copier: --> 150 y = copier(x, memo) 151 else: 152 try: ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _deepcopy_dict(x, memo, deepcopy) 238 memo[id(x)] = y 239 for key, value in x.items(): --> 240 y[deepcopy(key, memo)] = deepcopy(value, memo) 241 return y 242 d[dict] = _deepcopy_dict ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 178 y = x 179 else: --> 180 y = _reconstruct(x, memo, *rv) 181 182 # If is its own copy, don't memoize. ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 278 if state is not None: 279 if deep: --> 280 state = deepcopy(state, memo) 281 if hasattr(y, '__setstate__'): 282 y.__setstate__(state) ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 148 copier = _deepcopy_dispatch.get(cls) 149 if copier: --> 150 y = copier(x, memo) 151 else: 152 try: ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _deepcopy_dict(x, memo, deepcopy) 238 memo[id(x)] = y 239 for key, value in x.items(): --> 240 y[deepcopy(key, memo)] = deepcopy(value, memo) 241 return y 242 d[dict] = _deepcopy_dict ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 178 y = x 179 else: --> 180 y = _reconstruct(x, memo, *rv) 181 182 # If is its own copy, don't memoize. ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 278 if state is not None: 279 if deep: --> 280 state = deepcopy(state, memo) 281 if hasattr(y, '__setstate__'): 282 y.__setstate__(state) ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 148 copier = _deepcopy_dispatch.get(cls) 149 if copier: --> 150 y = copier(x, memo) 151 else: 152 try: ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _deepcopy_dict(x, memo, deepcopy) 238 memo[id(x)] = y 239 for key, value in x.items(): --> 240 y[deepcopy(key, memo)] = deepcopy(value, memo) 241 return y 242 d[dict] = _deepcopy_dict ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 178 y = x 179 else: --> 180 y = _reconstruct(x, memo, *rv) 181 182 # If is its own copy, don't memoize. ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _reconstruct(x, memo, func, args, state, listiter, dictiter, deepcopy) 278 if state is not None: 279 if deep: --> 280 state = deepcopy(state, memo) 281 if hasattr(y, '__setstate__'): 282 y.__setstate__(state) ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 148 copier = _deepcopy_dispatch.get(cls) 149 if copier: --> 150 y = copier(x, memo) 151 else: 152 try: ~\AppData\Local\Continuum\anaconda3\lib\copy.py in _deepcopy_dict(x, memo, deepcopy) 238 memo[id(x)] = y 239 for key, value in x.items(): --> 240 y[deepcopy(key, memo)] = deepcopy(value, memo) 241 return y 242 d[dict] = _deepcopy_dict ~\AppData\Local\Continuum\anaconda3\lib\copy.py in deepcopy(x, memo, _nil) 167 reductor = getattr(x, "__reduce_ex__", None) 168 if reductor: --> 169 rv = reductor(4) 170 else: 171 reductor = getattr(x, "__reduce__", None) TypeError: can't pickle CompiledFFI objects
The text was updated successfully, but these errors were encountered: