Open
Description
When trying to retrieve a list of WordPress posts, I got the error module 'collections' has no attribute 'Iterable'
. This is because in Python 3.10, the version I was using, the Iterable
class has been moved to the collections.abc
module.
In order to solve this error, after installing the library with pip install python-wordpress-xmlrpc
, open the wordpress_xmlrpc folder (it should be in your virtual environment), then open the file base.py.
Here, you need to make two replacements:
- At line 1, replace
import collections
withimport collections.abc
- At line 128, replace
elif isinstance(raw_result, collections.Iterable):
withelif isinstance(raw_result, collections.abc.Iterable):
That should fix the error and allow the script to parse the raw result from the WordPress site.
Metadata
Metadata
Assignees
Labels
No labels